[android-developers] Custom Dialog without context application

2011-01-29 Thread Antony BODY
Hi all,

I'm trying to create an dialog wich is show on android desktop.
My application contains a service who create notification. On
notification click I would like show a dialog on desktop.
My problem: each time I click on notification my dialog is showing
with black screen behind (activity of my application).

Notification notification = new Notification(R.drawable.charges, text,
System.currentTimeMillis());
Intent myIntent = new Intent(getApplicationContext(),
MyActivity.class);
myIntent.putExtra(extra, extra);
PendingIntent contentIntent = PendingIntent.getActivity(this,
0,myIntent, 0);
notification.setLatestEventInfo(this, getText(R.string.app_name),text,
contentIntent);
notificationManager.notify(notifId, notification);

How I should I do? My activity should be declare in specific way ?
My activity just declare a custom dialog and show it in onCreate
method.

Thanks for help,
Regards.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Custom Dialog without context application

2011-01-29 Thread Kostya Vasilyev

Anthony,

Rather than using a dialog, make an Activity that looks like one with this:

activity name, label...
android:theme=@android:style/Theme.Dialog/

-- Kostya

29.01.2011 15:51, Antony BODY пишет:

Hi all,

I'm trying to create an dialog wich is show on android desktop.
My application contains a service who create notification. On
notification click I would like show a dialog on desktop.
My problem: each time I click on notification my dialog is showing
with black screen behind (activity of my application).

Notification notification = new Notification(R.drawable.charges, text,
System.currentTimeMillis());
Intent myIntent = new Intent(getApplicationContext(),
MyActivity.class);
myIntent.putExtra(extra, extra);
PendingIntent contentIntent = PendingIntent.getActivity(this,
0,myIntent, 0);
notification.setLatestEventInfo(this, getText(R.string.app_name),text,
contentIntent);
notificationManager.notify(notifId, notification);

How I should I do? My activity should be declare in specific way ?
My activity just declare a custom dialog and show it in onCreate
method.

Thanks for help,
Regards.




--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en