DeviceAdminReceiver中的空构造函数异常

时间:2013-05-25 11:44:41

标签: android constructor broadcastreceiver super device-admin

E/AndroidRuntime(27856): java.lang.RuntimeException: Unable to instantiate receiver com.inc.statusbar.Statusbar$DeviceAdminSampleReceiver: java.lang.InstantiationException: can't instantiate class com.inc.statusbar.Statusbar$DeviceAdminSampleReceiver; no empty constructor

我已经尝试调用DeviceAdminReceiver类的默认构造函数但没有用。删除构造函数也会产生相同的错误。 DeviceAdminSampleReceiver班级定义 -

public class DeviceAdminSampleReceiver extends DeviceAdminReceiver
{

    public DeviceAdminSampleReceiver()
    {
        super();    
    }

    @Override
    public void onEnabled(Context context, Intent intent) {
        super.onEnabled(context, intent);
    }

    @Override
    public CharSequence onDisableRequested(Context context, Intent intent) {
        super.onDisabled(context, intent);
        return "admin_receiver_status_disable_warning";
    }

    @Override
    public void onDisabled(Context context, Intent intent) {
        super.onDisabled(context, intent);
    }

}

0 个答案:

没有答案