Android function

  • Posted:
  • Proposals: 4
  • Remote
  • #102047
  • Archived
Spencer P.Akhilesh S.Anthony E.GLK K. have already sent a proposal.
  • 0


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 the notification is clicked on the mobile and depending on the user choice, if he clicks OK then it posts a variable to an HTTP link, 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);


if you also need my project file i will also give it. thanks!

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.