Wednesday, 2 September 2015

android customized AlertDialog, findViewById, java.lang.NullPointerException

If you customized a AlertDialog (with a layout file), you may get "NullPointerException" when you try to get element by "findViewById":


That because you try to get the element before the page is ready.


Do that after:;


Same as activity, you can't do the same call before "setContentView(R.layout.activity_info);"

No comments:

Post a comment