我想从 的onReceive()
方法启动一个 Activity BroadcastReceiver
,但 ActivityNotFound
每次都会发生异常。请检查并告诉我我的代码有什么问题
<activity android:name="NearbyFriends"></activity>
<receiver android:name="AlarmManagerBroadcastReceiver"/>
调用另一个活动的代码是
Intent intent1 = new Intent();
Intent1.setClassName("com.android.letscatchupclientside","com.android.letscatchupclientside.NearbyFriends");
intent1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent1);