I have a program that uses a Map View and when they click a menu item
it prompts them (in a Dialog box) to enter a name and then press
enter. Once they press enter I want to take what was received in the
Text Edit in the dialog box and display it in a toast. However, it
seems that I just get a blank toast when I try this. Here's some code:

I use getters and setters to accomplish this:

        public void setText(String text) {
                test = text;
        }
        public String getText() {
                return test;
        }

My button listener:

            btn_save = (Button) findViewById(R.id.btn_save);
            btn_save.setOnClickListener(new Button.OnClickListener() {
                public void onClick(View v) {
                        setText(add_dialog_editText.getText().toString());
                        dismiss();
                }
            });

I then call the dialog in my ItemizedView class:

                                POIDialog d = new POIDialog(mContext);
                                d.setTitle("Add a POI");
                                d.setContentView(R.layout.adddialog);
                                d.show();

But when I use d.getText(), it wont show the value that was entered in
the box. Is there a better way to receive entered data in a dialog
box?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to