当用户启动应用程序时,我只想显示一个按钮。用户可以继续使用手机。 示例:(问题是图标不可点击)
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
答案 0 :(得分:0)
http://developer.android.com/reference/android/Manifest.permission.html#SYSTEM_ALERT_WINDOW
" android.permission.SYSTEM_ALERT_WINDOW"在主宴中使用此权限
windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
Button btn = new ImageView(this);
WindowManager.LayoutParams params = new WindowManager.LayoutParams(
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.TYPE_PHONE,
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
PixelFormat.TRANSLUCENT);
windowManager.addView(btn, params);