Android 当任何按钮点击时,如何阻止应用程序从通知面板启动?
我有一个带有两个按钮的通知面板。当我点击任一按钮时,最小化的应用程序将被打开/恢复Android 当任何按钮点击时,如何阻止应用程序从通知面板启动?,android,android-notifications,android-notification-bar,Android,Android Notifications,Android Notification Bar,我有一个带有两个按钮的通知面板。当我点击任一按钮时,最小化的应用程序将被打开/恢复 public void setListeners(RemoteViews view){ Intent stopNotify = new Intent(parent,HelperActivity.class); stopNotify.putExtra("DO", "stop"); PendingIntent btn1 = PendingIntent.getActivity(parent,
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);
}
我希望应用程序本身保持最小化。我错过什么了吗
是否需要为PendingContent添加任何参数
提前谢谢
我希望应用程序本身保持最小化。我错过什么了吗
您正在为这些视图提供挂起内容,这些视图将在单击这些视图时启动活动
如果您不希望这样做,请不要提供将启动活动的挂起内容