Closed FeedyFeedback closed 8 years ago
You can do something like this.
public void askLogin(View view) {
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View customView = inflater.inflate(R.layout.login, null);
final EditText school = (EditText) customView.findViewById(R.id.editTextSchool);
final Button btn = (Button) customView.findViewById(R.id.button20);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
logMeIn(school.getText().toString());
}
});
new MaterialStyledDialog(this)
.setDescription("Vul hier uw school en koppelcode in.")
.setCustomView(customView)
.setIcon(R.drawable.z)
.show();
}
public void logMeIn(String string) {
System.out.println(school);
}
Hope it helps you.
How can I get the value of an editText when I'm using a custom view?
This is my function code:
This is the function I am calling when I click on the login button:
And this is my login.xml
What am I doing wrong?