Dialog Information Retrieval - Android Community Forums
Register Members List Social Groups Calendar Search Today's Posts Mark Forums Read


Go Back   Android Community Forums > Android Discussions > General Dev Discussions, How to, Guides and FAQ


General Dev Discussions, How to, Guides and FAQ Discuss Android Development How to and Guides here. No commercial posts please!

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-03-2009, 04:11 PM
aspekt9 aspekt9 is offline
aspekt9 is frustrated
Smoke signaler
 
Join Date: Jul 2009
Posts: 3
aspekt9 is on a distinguished road
Default Dialog Information Retrieval

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:

Code:
public void setText(String text) {
        test = text;
    }
    public String getText() {
        return test;
    }
My button listener:

Code:
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:

Code:
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?
Reply With Quote
Ads
 

Bookmarks


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump

Ads

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to send contact information brie987 Android OS Discussions 2 05-04-2009 07:18 PM
information on flash jujufisticuffs General Dev Discussions, How to, Guides and FAQ 2 02-24-2009 05:06 PM
Pictures of the OTA update & new USB connection dialog mixpix405 HTC Handsets 12 11-06-2008 12:40 PM
Auto retrieval of email issues?? Gthmcty1 HTC Handsets 6 10-28-2008 04:05 AM
Google Talk Presence Information jaroque HTC Handsets 0 10-22-2008 02:53 PM


All times are GMT -5. The time now is 07:33 AM.



Copyright © 2008-2009 Android Community / R3 Media LLC, All Rights Reserved.