java - get text from dialog android -


after executing showdialog method value of string s stays same , doesn't change input of edittext

can tell me why?

string s ="";  public void showdialog(string text) {      final alertdialog.builder builder = new alertdialog.builder(this);     final layoutinflater inflater = this.getlayoutinflater();      builder.setview(inflater.inflate(r.layout.dialouge, null))             .setpositivebutton("ok", new dialoginterface.onclicklistener() {                 @override                 public void onclick(dialoginterface dialog, int id) {                     dialog f = (dialog) dialog;                     edittext edittext = f.findviewbyid(r.id.markers_name);                     s=edittext.gettext().tostring();                  }             })             .setnegativebutton("cancel", new dialoginterface.onclicklistener() {                 public void onclick(dialoginterface dialog, int id) {                     dialog.cancel();                 }             });      builder.show(); }     


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -