call activity method from broadcast receiver

后端 未结 5 1892
小蘑菇
小蘑菇 2020-12-03 11:33

In the main activity, a layout is loaded that has some input fields and a submit button. When the submit button is clicked, the onClick handler method sends an sms back to t

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-03 11:39

    use this

    Intent intent=new Intent();
    intent.setClassName("com.package.my", "bcd.class");
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    
    context.startActivity(intent);
    

提交回复
热议问题