nevermind I solve the problem

On Oct 29, 8:05 pm, akurni <[EMAIL PROTECTED]> wrote:
> Hi, I'm trying to set a notification from my application and when a
> user click the notification it will open my application with the data.
> the notification works fine, but the my application also get launch
> when the notification being set. I thought the intent that I set up in
> pending intent will only get launch when the notification is clicked
> by the user.
>
> The code for setting up the notification
>
>  protected void showNotification() {
>         // look up the notification manager service
>         NotificationManager nm =
> (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
>
>         Intent newIntent = new Intent(Intent.ACTION_VIEW, mUri, this,
> NoteEdit.class);
>         newIntent.putExtra(getString(R.string.clear_notification),
> true);
>         newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
>         // The PendingIntent to launch our activity if the user
> selects this notification
>         PendingIntent contentIntent = PendingIntent.getActivity(this,
> 0,
>                         newIntent, 0);
>
>         // The ticker text, this uses a formatted string so our
> message could be localized
>         String tickerText =
> getString(R.string.note_reminder_notification) + " " + mTitle;
>
>         // construct the Notification object.
>         Notification notif = new
> Notification(R.drawable.ic_notification, tickerText,
>                 System.currentTimeMillis());
>
>         // Set the info for the views that show in the notification
> panel.
>         notif.setLatestEventInfo(this, mTitle, mNote, contentIntent);
>
>         // after a 100ms delay, vibrate for 250ms, pause for 100 ms
> and
>         // then vibrate for 500ms.
>         //notif.vibrate = new long[] { 100, 250, 100, 500};
>
>         // Note that we use R.layout.incoming_message_panel as the ID
> for
>         // the notification.  It could be any integer you want, but we
> use
>         // the convention of using a resource id for a string related
> to
>         // the notification.  It will always be a unique number within
> your
>         // application.
>         int notifId = R.string.note_reminder_notification + mId;
>         nm.notify(notifId, notif);
>     }
>
> Anybody can give me some pointer why it's doing this? Is there anyway
> to get the sender info of an intent on the receiver side?
>
> Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to