Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有四节课。其中之一是广播接收器;其他三个是正常的类扩展活动。我正在将这些活动之一的信息发送到广播接收器。现在我想知道是否有办法根据广播接收器中收到的值来运行剩余的两个活动中的任何一个。
您可以使用意图组件,如下所示
public class YourbroadcastReceiver extends BroadcastReceiver { public void onReceive(Context ctx, Intent intent) { //start activity Intent myi=new Intent(ctx,YourAnotherActivity.class); ctx.startActivity(myi); }