Note that there are some explanatory texts on larger screens.

plurals
  1. POnotification shows but not loading next Activity
    text
    copied!<pre><code>private void generateNotification() { // TODO Auto-generated method stub String notificationTicket=new Date(System.currentTimeMillis()).toLocaleString(); long when=System.currentTimeMillis(); Notification myNotification=new Notification(R.drawable.ic_launcher, notificationTicket, when); Intent intent=new Intent(getApplicationContext(),MyNewActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent pendingIntent=PendingIntent.getActivity(getApplicationContext(), 0, intent, 0); myNotification.setLatestEventInfo(getApplicationContext(), null, "Hi some package Added", pendingIntent); notificationManager.notify(0, myNotification); } </code></pre> <p>I have used a button to fire notiification and it shows on my ActionBar but it doesn't load the new Activity I want. I have already define my NotificationManager earlier. There is also a button for cancel notification but It doesn't worth as notification fire only for "some seconds". Thanks in Advance.</p> <pre><code>startButton=(Button)findViewById(R.id.button1); startButton.setOnClickListener(this); stopButton=(Button)findViewById(R.id.button2); stopButton.setOnClickListener(this); notificationManager=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE); </code></pre> <p>Still I am finding solution to run my notification successfully!!!! I display the message but the activity which I am tring to trigger after notified to user,is not working.... I just require a single demo of notification which give the result and I will complete the rest. Thanks again. I am looking for your kindly reply..</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload