tags:

views:

37

answers:

1

Hy!

    public static void addNotification(String sAppname, String sDescription) {

     NotificationManager notifManager = (NotificationManager) mycontext.getSystemService(NOTIFICATION_SERVICE);  
     Notification note = new Notification(R.drawable.icon, sDescription, System.currentTimeMillis());  

     Intent i = new Intent (mycontext, mStart.class)
             .setAction(Intent.ACTION_MAIN)
             .setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);

     PendingIntent contentIntent = PendingIntent.getActivity(mycontext, 0, i, 0); 

     note.setLatestEventInfo(mycontext, sAppname, sDescription, contentIntent);  

     notifManager.notify(NOTIFY_ID, note);  

}

mStart is my first activity

if i click on the notification this code is "re-create" the intent, and show up a new one.

i dont want this. i d like to show up the existing main intent. how to?

A: 

The solution is:

in manifest file add the following: singleTask="true"

lacas