Display Dialog from notification

by julius » Wed, 03 Mar 2010 02:41:51 GMT

Sponsored Links

I have a situation where I have a broadcast receiver which creates a
notification and the notification, when selected, sends the
application to a new Activity with a yes/no AlertDialog. I have two

1. Is it possible to show an AlertDialog (from the notification)
without sending the user to a new Activity? (This way the user can
click No and resume working in any other application)

2. A ListActivity already exists in this application. If the user
clicks yes the user should be send to this existing Activity.
Currently I'm dong this from a new activity in the application using:
startActivity(new Intent(this,MSPMain.class));
I believe this is making a new instance of the Activity rather than
simply showing the existing Activity. Is there a way to show the
existing Activity without making starting a new one?

I hope this makes sense... :)

Thank you for any help.


Display Dialog from notification

by Mark Murphy » Wed, 03 Mar 2010 02:46:15 GMT


I don't think so. You can always create a dialog-themed activity, so it
looks like a dialog, but isn't.

Look at android:launchMode:

 http://developer.android.com/guide/topics/manifest/activity-element.html #lmode

Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

Android Training in NYC: 1-2 May 2010:  http://guruloft.com 


Sponsored Links

Display Dialog from notification

by Julius Spencer » Wed, 03 Mar 2010 18:06:37 GMT

 Thanks for the reference Mark. I realised from an Activity I can just finish it 
and it will show the other Activity.


Other Threads

1. how to set EditText 's password attribute in the code

look at the setTransformationMethod() - for instance, to turn password
mode on:



2. R.drawable.list_selector_background doesn't yield in orange

It's default state is transparent actually :)

Romain Guy
Android framework engineer

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them


3. API for reading the framebuffer

4. Creating multiple tabs :one after another

5. dtd/xsd for AndroidManifest.xml

6. smoother indeterminate progress animation

7. Unable to get Hello World working