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. C2DM Push not reaching device

Hi all,

I've encountered an odd issue with C2DM.

In the past weeks, I've been able to successfully register and receive
push notifications.

Recently though, my device can register successfully but push
notifications aren't reaching the device (receive method is never
getting hit after a registration id is received).

The HTTPPOST for the push notification receives an HTTP OK response.

Ideas? Suggestions?



2. OnTouchListener - repeat action on hold

Hi there, I'm new to Android (and programming if I'm honest).. but I'm
starting to grasp how things work :)  With the help of a few books and
tutorials things seem to be buzzing along nicely. Something that I've
struggled to find much info about is the implementation of
OnTouchListener and how I can get an action to repeat whilst holding a
button - implementing my own backspace key.

With the help of a friend who's also never touched Android
development, but regularly codes, we've managed to figure it out.. but
it seems sloppy. I'm wondering if there's any cleaner way to achieve
my goal?  Any advice would be great to hear.

Here's the code.

I've tried my best to extract the relevant parts of the code -
apologies if bits are badly formatted / missing.





3. Need a small tablet platform that runs Android OS.

4. Running Android CTS on an emulator

5. how to use AmrInputStream

6. Accessing Display Frame Buffers

7. button on screen that controls page sliding