0

I have a notification panel with two buttons. When I click on either of the buttons the minimized application is getting opened/resumed.

  public void setListeners(RemoteViews view){
    Intent stopNotify = new Intent(parent,HelperActivity.class);
    stopNotify.putExtra("DO", "stop");
    PendingIntent btn1 = PendingIntent.getActivity(parent, 0, stopNotify, 0);
    view.setOnClickPendingIntent(R.id.notifyStopButton, btn1); 

    Intent pauseUpload = new Intent(parent,HelperActivity.class);
    pauseUpload.putExtra("DO", "pause");    
    PendingIntent btn2 = PendingIntent.getActivity(parent, 1, pauseUpload, 0);
    view.setOnClickPendingIntent(R.id.uploadPauseButton, btn2); 
   }

I want the application to be stayed minimized itself. Am I missing something?

Do I need to add pass any parameter for pendingIntent?

Thanks in advance!!

Jaswanth Kumar
  • 3,531
  • 3
  • 23
  • 26

1 Answers1

0

I want the application to be stayed minimized itself. Am I missing something?

You are providing PendingIntents to those views that will start an activity when those views are clicked.

If you do not want this, do not provide PendingIntents that will start an activity.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491