当我启动 android 时,我希望屏幕自动解锁(并运行应用程序)而不是我解锁屏幕。谁能告诉我必须在哪里更改内核源代码?
java代码在这里..你能纠正一下吗
public class AddnumsActivity extends BroadcastReceiver {
private static final String KEYGUARD_SERVICE = null;
@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
KeyguardManager keyguardManager = (KeyguardManager)context.getSystemService(Activity.KEYGUARD_SERVICE);
KeyguardLock lock = keyguardManager.newKeyguardLock(KEYGUARD_SERVICE);
lock.disableKeyguard();
if ("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) {
Intent pushIntent = new Intent(context, AddnumsActivity.class);
pushIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(pushIntent);
}
}
}