Android Timers Crashing On Cancel
listed in answer
ANSWER:
mailbutton = (Button) findViewById(R.id.emailbutton);
the above line must be in oncreate() because you have a view(R.layout.main) set in oncreate and you function addListenerOnButton() doesn’t know about main layout.
and if still want to it to be in your function then inflate the main.xml and do it.

New Comments