Hello,

I've written a camera application which presents the user with a set
of pre-defined tags to choose from. I've done this using an
alertdialog which fires an intent when the user presses one of the tag
options. I want to be able to get the user to add their own tag if
they feel the listed ones aren't appropriate. If the user selects the
'add new tag' option from the first alertdialog i want it to give them
a text box to type in some text, which if selected fires off an
alert.  Whats the best way to go about this? I've been playing around
with the alertdialog spawning another AlertDialog with an edittext box
and an ok button but can't get it working. Any pointers?

Thanks,

George

                        ArrayAdapter<String> array_adapter = new 
ArrayAdapter<String>(
                                        CameraFinal.this, 
R.layout.simple_list_item_1, tagsf);

                        Builder alert4 = new 
AlertDialog.Builder(CameraFinal.this)
                                        .setTitle("Select a tag")

                                        .setAdapter(array_adapter,
                                                        new 
DialogInterface.OnClickListener() {
                                                                public void 
onClick(DialogInterface dialog,
                                                                                
int which) {

                                                                        float 
orientation = mValues[1];
                                                                        Intent 
sendIntent = new Intent(
                                                                                
        Intent.ACTION_SEND);
                                                                        
sendIntent.setType("image/jpeg");
                                                                        
String[] recipients = { "picsh...@fuzzmonkey.co.uk" };
                                                                        
sendIntent.putExtra(Intent.EXTRA_STREAM,
                                                                                
        uri);
                                                                        
sendIntent.putExtra(Intent.EXTRA_SUBJECT,
                                                                                
        "");
                                                                        
sendIntent.putExtra(Intent.EXTRA_EMAIL,
                                                                                
        recipients);
                                                                        String 
selected = tags.get(which);
                                                                        String 
emailtxt = etext + " " + orientation
                                                                                
        + " " + goalid + " " + selected;
                                                                        
sendIntent.putExtra(Intent.EXTRA_TEXT,
                                                                                
        emailtxt);
                                                                        
startActivity(Intent.createChooser(
                                                                                
        sendIntent, "Send to Server!"));

                                                                }
                                                        
}).setNeutralButton("Close",
                                                        new 
DialogInterface.OnClickListener() {
                                                                public void 
onClick(DialogInterface dialog,
                                                                                
int whichButton) {
                                                                        // Put 
your code in here for a neutral
                                                                        // 
response
                                                                }
                                                        });

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

Reply via email to