android - EditText.getText in popup window dialog -


i dont know why youtue_title , youtube_description null ??? after add text edittext ??? time why not work ? ??

is there problem because in popup window?

    public void popup_win_with_layout (){        //select video upload youtube      //popup window        alertdialog.builder popupwin = new alertdialog.builder(this);     layoutinflater inflater = this.getlayoutinflater();            //try     popupwin.settitle("y");      popupwin.seticon(r.drawable.ic_launcher);      popupwin.setview(inflater.inflate(r.layout.pop_up_win, null)).setpositivebutton(getstring(r.string.continue), new dialoginterface.onclicklistener()      {     public void onclick(dialoginterface dialog, int id)     {     //action 'ok' button        edittext youtue_title;        edittext youtube_description;       youtue_title=(edittext)findviewbyid(r.id.youtue_title); //why youtue_title null ?????          youtube_description=(edittext)findviewbyid(r.id.youtube_description); ////why youtube_description null ?????          video_title = youtue_title.gettext().tostring();        video_description = youtube_description.gettext().tostring();        log.d(tag, video_title +video_description );         pickvideo() ;                       }     });        popupwin.show(); } 

replace:

youtue_title=(edittext)findviewbyid(r.id.youtue_title); youtube_description=(edittext)findviewbyid(r.id.youtube_description); 

with:

    youtue_title=(edittext)((alertdialog)dialog).findviewbyid(r.id.youtue_title);     youtube_description=(edittext)((alertdialog)dialog).findviewbyid(r.id.youtube_description); 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -