我对使用本地广播的挂起意图很感兴趣。为了让自己清楚,我正在使用以下内容注册接收器并发送广播: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);