1

im trying to launch application form notification using Android Edk. I succeded to display notification. But i want to launch my application from notification and i can`t make it work. Notification is received when application is not running, is triggered from a broadCast reciever.
I think my problem is related to the activity that i created from notification intent.

Here the notification function:

 Intent resultIntent = new Intent(context, TaskManagerActivity.class);
    resultIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
    PendingIntent resultPendingIntent = PendingIntent.getActivity( context, 0, resultIntent, 0);

    NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context )
    .setSmallIcon(R.drawable.ic_menu_day)
        .setContentTitle(title)
        .setContentText(message)
        .setContentIntent(resultPendingIntent)
        .setWhen(System.currentTimeMillis());

    NotificationManager manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
manager.notify(0, mBuilder.build());

And here is my activity class:

public class TaskManagerActivity extends Activity {

public static TaskManagerActivity m_Activity;
private static final String TAG = "TaskManagerActivity";

protected void onCreate(Bundle savedInstanceState)
{

    super.onCreate(savedInstanceState);
 //   setContentView(R.layout.main);

}

}

benoma777
  • 75
  • 1
  • 6

1 Answers1

0

Have a look at official docs of Android about notification. Also I'd suggest you to read this post of SO.

Community
  • 1
  • 1
0xC0DED00D
  • 19,522
  • 20
  • 117
  • 184
  • 1
    https://devnet.madewithmarmalade.com/questions/16205/launch-application-from-notification-android-edk.html – 0xC0DED00D Oct 17 '13 at 09:57