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

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

问题描述

任何一个可以帮助我如何检测的Andr​​oid应用程序启动器/启动?

和简要地给一些想法......

我要检测启动应用程序。哪一个应用程序启动器,我想我推密码屏幕之后,它会去申请..它是相同的应用程序更衣室


解决方案

 进口android.content.BroadcastReceiver;
进口android.content.Context;
进口android.content.Intent;
进口android.os.Vibrator;
进口android.widget.Toast;公共类MyBroadcastReceiver扩展广播接收器{
  @覆盖
  公共无效的onReceive(上下文的背景下,意图意图){
Toast.makeText(背景下,不要panik但你的时间到了!!!!
    Toast.LENGTH_LONG).show();
//震动移动电话
振动器振动=(振动器)context.getSystemService(Context.VIBRATOR_SERVICE);
vibrator.vibrate(2000);
  }}

和通也意图过滤在Android清单文件

Any one can help me 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);
  }

} 

and also pass intent filter in android manifest file

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

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