Android开发中使用广播时遇到如下问题:
java.lang.InstantiationException: class has no zero argument constructor
解决方案:
1,如果是静态广播注册方式、广播作为内部类来使用:广播内部类声明为static类型。
2,如果是非静态广播注册方式:广播必须在类中注册(调用registerReceiver()方法)、注销(调用unregisterReceiver()方法)。
未经允许不得转载:天宝寺||陈瑞轩 » Android使用广播时出现异常:java.lang.InstantiationException: class has no zero argument constructor