java - Some nethods in my main Activity are showing as never used -


these 2 methods adduser() , viewdetails() methods not being used in main activity file. find reason, don't know have call them. using android studio.

public class mainactivity extends appcompatactivity {      edittext username, password;      databaseadapter databasehelper;      @override     protected void oncreate(bundle savedinstancestate) {         super.oncreate(savedinstancestate);         setcontentview(r.layout.activity_main);          username = (edittext) findviewbyid(r.id.edittextuser);         password = (edittext) findviewbyid(r.id.edittextpass);         databasehelper = new databaseadapter(this);     }      public void adduser(view view) {          string user = username.gettext().tostring();         string pass = password.gettext().tostring();          long id = databasehelper.insertdata(user, pass);         if (id < 0) {             message.message(this, "unsuccessful");         } else {             message.message(this, "successful");         }     }      public void viewdetails(view view) {         string data = databasehelper.getalldata();         message.message(this, data);     } } 

after watching code declaring function , give definition of function not using or calling .. that's why android studio show not using method's... can call method adduser(); or viewdetails();


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -