我有兴趣在本地广播中使用未决意图。为了清楚起见,我使用以下内容注册接收器和发送广播:android.support.v4.content.LocalBroadcastManager
.
我在一个有效的服务中有一个本地广播接收器。我正在尝试从包含可点击项目的自定义通知布局发送本地广播。
本地广播接收器 - 只接收简单的动作意图。我正在尝试这样的事情无济于事:
Intent backintent = new Intent("GOTO_START_BROADCAST");
PendingIntent backIntent = PendingIntent.getBroadcast(getApplicationContext(), 0, backintent, 0);
RemoteViews contentView = new RemoteViews(getPackageName(), R.layout.custom_notification);
contentView.setOnClickPendingIntent(R.id.imageView1, backIntent);