I have one Android application, when it starts the service, I want to show a notification in the status bar. Then the user can switch to another application by pressing the HOME key. However, when I try to return the previous running application to the Front through the notification icon, there are some problems with the existing activity. Even I declare it as a "Single Top" mode (I want to start an existing activity, since there is work associated with it), anyway, that the OnDestroy activity was called before OnResume. Here is my notification object creation code. Could you please indicate that this is not so. Thank you
private void showNotification () { Intent toLaunch = new Intent(getApplicationContext(), MySingleTopActivity.class); PendingIntent intentBack = PendingIntent.getActivity(getApplicationContext(), 0,toLaunch, PendingIntent.FLAG_UPDATE_CURRENT); notification.setLatestEventInfo(getApplicationContext(), getText(R.string.GPS_service_name), text, intentBack); .... }
android
user404012 Jul 28 '10 at 18:20 2010-07-28 18:20
source share