Display Dialog from notification

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


Sponsored Links
 Hi,

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

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. Can't change date/time on Gingerbread? (iMX R10 and R10.1)

Hi all!

I've ported Android 2.3.3 to my Freescale iMX-based board, and for
some reason I cannot change the date or time.  (This problem occurred
on IMX's R10 and R10.1 releases.)

Changing the value in settings has no effect.  Moreover, the time in
the top-right notification area does not refresh every minute.

Logcat output follows:
I/ActivityManager( 2135): Starting: Intent
{ act=android.intent.action.MAIN
cmp=com.android.settings/.DateTimeSettings } from pid 2392
I/SurfaceFlinger( 2135): mHw->getFormat() 4
I/ActivityManager( 2135): Displayed
com.android.settings/.DateTimeSettings: +403ms
D/SystemClock( 2392): Setting time of day to sec=1293840988
W/SystemClock( 2392): Unable to open alarm driver: No such file or
directory

I'm not sure if it's in any way related, but I dmesg output shows the
following:
<7>Waiting arm_podf enabled!

Appreciate any advice or troubleshooting tips.

Best regards,

Jim

-- 

2. Downloading image from URL with spaces in the path in Android

Hi, I want to download image from the path. This is my code:

String urlString = 
"http://www.hospimedica.com/images/stories/articles/article_images/_CC/20110328 
- DJB146.gif";
url = new URL(urlString.replaceAll(" ", "%20"));
bm = BitmapFactory.decodeStream(url.openConnection().getInputStream());

But it returns me null in bm. Any ideas how to make this code to work?


-- 

3. dispatch key events to other activities.

4. changing Font Size on Selection

5. MapActivity

6. Phone for development

7. how do i change search location in android browser