如何检测Android应用程序启动/启动程序 [英] How to detect Android Application Boot/Launcher

查看:263
本文介绍了如何检测Android应用程序启动/启动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检测Android应用启动器/启动?

How to detect Android application launcher/boot?

并简要地提出一些想法.

And give some idea briefly.

我想检测启动器应用程序.哪个应用程序是启动器,我要在进入应用程序后按下密码屏幕.它是相同的应用程序储物柜

I want to detect launcher application. which application is launcher i want to push my password screen after that it will go to application.. it's same app locker

推荐答案

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Vibrator;
import android.widget.Toast;

public class MyBroadcastReceiver extends BroadcastReceiver {
  @Override
  public void onReceive(Context context, Intent intent) {
Toast.makeText(context, "Don't panik but your time is up!!!!.",
    Toast.LENGTH_LONG).show();
// Vibrate the mobile phone
Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
vibrator.vibrate(2000);
  }

} 

,并在Android清单文件中传递意图过滤器

and also pass intent filter in android manifest file

这篇关于如何检测Android应用程序启动/启动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆