java - User input from editText to a String -


i looks simple question, can't manage work.

i'm trying make weather app, , im using yahoo api, , app works:

        service.refreshweather("dallas, tx"); 

i wanted make user input city, made this:

    mbutton = (button)findviewbyid(r.id.mdugme);     medit = (edittext)findviewbyid(r.id.unesigrad);     string userinput11;        mbutton.setonclicklistener(             new view.onclicklistener()             {                 public void onclick(view view)                 {                      userinput11 = medit.gettext().tostring();                 }             });      service.refreshweather(userinput11); 

why isn't working?

take code

mbutton.setonclicklistener(             new view.onclicklistener()             {                 public void onclick(view view)                 {                      userinput11 = medit.gettext().tostring();                 }             });      service.refreshweather(userinput11); 

and reorder this

mbutton.setonclicklistener(                 new view.onclicklistener()                 {                     public void onclick(view view)                     {                          userinput11 = medit.gettext().tostring();                          service.refreshweather(userinput11);                     }                 }); 

it may demand declare service final. not sure. follow ide instructions.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -