Android

  • Posted:
  • Proposals: 2
  • Remote
  • #101585
  • Archived
Akhilesh S.GLK K. have already sent a proposal.
  • 0

Description

Experience Level: Intermediate
i am developping an android application, the app receives notifications from a server, whenever a notification is received it pops up the the notification area of the android, when clicked it gives you access to the application...what i need is to set a confirmation after a notification is received on my mobile and depending on the user choice, if he clicks OK then it does a certain method, if he clicks cancel then nothing happens... i am using the following code for now that when an incoming notification is clicked it only opens the application... thank you for your prompt help coz i need this very fast...thanks again.

private void showNotification(String text) {

Notification n = new Notification();

n.flags |= Notification.FLAG_SHOW_LIGHTS;
n.flags |= Notification.FLAG_AUTO_CANCEL;

n.defaults = Notification.DEFAULT_ALL;

n.icon = R.drawable.icon;
n.when = System.currentTimeMillis();

// Simply open the parent activity
PendingIntent pi = PendingIntent.getActivity(this, 0, new Intent(this, Home.class), 0);


// Change the name of the notification here
n.setLatestEventInfo(this, NOTIF_TITLE, text, pi);


mNotifMan.notify(NOTIF_CONNECTED, n);

// CharSequence text2 = "Hello toast!";
// int duration = Toast.LENGTH_SHORT;

//Toast toast = Toast.makeText(context, text2, duration);
// toast.show();

}

New Proposal

Create an account now and send a proposal now to get this project.

Sign up

Clarification Board Ask a Question

    There are no clarification messages.