【发布时间】:2014-12-29 14:24:11
【问题描述】:
我有一个带有两个按钮的通知面板。当我单击任一按钮时,最小化的应用程序正在打开/恢复。
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);
}
我希望应用程序本身保持最小化。我错过了什么吗?
是否需要为 pendingIntent 添加 pass 任何参数?
提前致谢!!
【问题讨论】:
标签: android android-notifications android-notification-bar