I am trying to start an activity from the notification bar but it needs to get an int. From activity to activity I would just put an int into the intent but I can't seem to figure out where to add the extra for the notification bar? Is this possible? If not is there a better way to do it?
public void notifyMe() {
int icon = android.R.drawable.presence_away;
CharSequence tickerText = "New Task Availible";
long when = System.currentTimeMillis();
Notification notification = new Notification(icon, tickerText, when);
Context context = getApplicationContext();
CharSequence contentTitle = "PRISM Task";
CharSequence contentText = "New Task Availible";
Intent notificationIntent = new Intent(this, TextAnswerActivity.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
notificationIntent.putExtra("taskId", 20); //unable to retrieve 20 later
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
final int HELLO_ID = 1;
mNotificationManager.notify(HELLO_ID, notification);
}
How I am retrieving:
Intent myIntent = getIntent();
System.out.println("#######TaskID from Intent ===== " + myIntent.getIntExtra("taskId", -1));