java - Dialog context issue - Android -
i have created dialog box using custom layout:
dialog = new dialog(fetchmenu.this, r.style.customdialogtheme); dialog.setcontentview(r.layout.custom_dialog_iab); dialog.show(); i trying edit textbox within 'layout.custom_dialog_iab' example:
textview text = (textview) findviewbyid(r.id.all_topics_unlock_button); text.settext("purchased"); my question: how right context able edit textboxes?
p.s. have tried 'dialog.getcontext()' still keep throwing null pointers?
you need use:
textview text = (textview) dialog.findviewbyid(r.id.all_topics_unlock_button); note dialog. in front of findviewbyid
regular findviewbyid() search activity layout rather dialog layout.
Comments
Post a Comment