Closed majid1605 closed 5 years ago
I would also like to know the answer to this. I wanted to get text from Edittext which is added in custom view using builder.setFooterView(R.layout.some_footer_layout);
@majid1605 @pocketutilities Both of these can be achieved as follows
View customView = getLayoutInflater().inflate(R.layout.child, null);
OnClickListener
, TextWatcher
or any such listener to the appropriate view.Header/Footer
.Let me know if you need any further help. You may also refer to the demo project in this repo.
why does the first code work and the second doesn't work?
customView.myBtnID.setOnClickListener {
Toast.makeText(this, "test", Toast.LENGTH_SHORT).show()
}
customView.setOnClickListener {
when(it.id)
{
R.id.myBtnID->
{
Toast.makeText(this, "test", Toast.LENGTH_SHORT).show()
}
}
and how dismiss dialog after click myBtn?or any object on my dialog?
Awesome that worked for me
@majid1605 You may keep a reference to the dialog using:
CFAlertDialog alertDialog = builder.show();
And on click listeners of any view you can call dismiss on the alertDialog
.
New Issue Checklist
Issue Info