How to register broadcast receiver?

前端 未结 3 1693
暖寄归人
暖寄归人 2020-12-18 12:08

Here is my source code and it keeps force closing everytime I run it...

public class MainActivity extends Activity {
    private static String content;
    p         


        
3条回答
  •  盖世英雄少女心
    2020-12-18 12:18

    The force close is likely happening because you are managing the UI from within your broadcast receiver. There's a 10-second limit on a BR's onReceive before it is forced closed.

    To solve, use an Activity component to generate your Toast.

提交回复
热议问题