界面细节几点

来源:互联网 发布:c语言字符串结束标志 编辑:程序博客网 时间:2024/05/02 03:09

隐藏Activity刚进来焦点在EditText时显示输入键盘

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

 

判断当前设备是模拟器还是真机

直接用IMEI来判断的。

/** 判断是否模拟器。如果返回TRUE,则当前是模拟器

* @param context

* @return

*/

public static boolean isEmulator(Context context){

TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);

String imei = tm.getDeviceId();

if (imei == null || imei.equals("000000000000000")){

return true;

}

return false;

}

 

监听APK安装完成

<receiver android:name=".XXReceiver">

<intent-filter>

<action android:name="android.intent.action.PACKAGE_ADDED"></action>

<data android:scheme="package" /><!-- 注意!! 这句必须要加,否则接收不到BroadCast -->

</intent-filter>

</receiver>

原创粉丝点击