Start application without activity, my Broadcast Receiver not work

后端 未结 5 1111
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-19 13:14

In my app, I have a Broadcast Receiver for catching the message sent to my phone



        
5条回答
  •  情深已故
    2020-12-19 13:38

    Ok. Here's what worked for me. I created a launcher activity. Removed the call to setContentView(R.layout.activity_main)

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //setContentView(R.layout.activity_main);
        finish();
    }
    

提交回复
热议问题