android 技巧

1、程序退出方法:

System.exit(0);
ActivityManager manager = (ActivityManager)getSystemService(ACTIVITY_SERVICE);   
manager.killBackgroundProcesses(getPackageName());
android.os.Process.killProcess(android.os.Process.myPid());
kill -9 pid
am force-stop com.lt.test

	public boolean isEmulator3() {
		String android_id = Settings.Secure.getString(getContentResolver(),
				Settings.Secure.ANDROID_ID);
		Log.d("ares", "ANDROID_ID: " + android_id);
		Log.d("ares", "Build.PRODUCT: " + Build.PRODUCT);
		boolean emulator = TextUtils.isEmpty(android_id)
				|| "google_sdk".equals(Build.PRODUCT)
				|| "sdk".equals(Build.PRODUCT) ||Build.PRODUCT.indexOf("sdk")!=-1;
		return emulator;
	}



你可能感兴趣的:(android 技巧)