android - No action After click on Button -


i created 1 button in android app,but when clicking on button,nothing happens.

protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.activity_search_data);     search =(button)findviewbyid(r.id.search);     search.setonclicklistener(new view.onclicklistener()   {         public void onclick(view v) {             try {                 new retrievedata().execute();             } catch (exception e) {                 e.printstacktrace();             }         }     }); } 

try initialize button in oncreate();


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -