5
我們將爲客戶提供設備,他們需要能夠通過按鈕撥打電話。在我的全屏Activity
我有一個按鈕,呼叫服務檯PHONENUMBER,所以onClick()
它執行以下操作:TYPE_KEYGUARD在撥打電話後保持全屏模式
try {
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
intent.setData(Uri.parse("tel:" + phoneNumber));
mContext.startActivity(intent);
} catch (Exception e) {
Toast.makeText(mContext, mContext.getString(R.string.couldntcall), Toast.LENGTH_LONG).show();
}
當撥號器關閉時,突然標題欄保持可見,I'm猜測它是與覆蓋在HOME
按鈕:
@Override
public void onAttachedToWindow()
{ //HOMEBUTTON
if(OnLockMode())
{
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
super.onAttachedToWindow();
}
else
{
this.getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION);
super.onAttachedToWindow();
}
}
是否有人有針對此問題的解決方案?
我試過如下:
我把清單:
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
和OnCreate
使用:
requestWindowFeature(Window.FEATURE_NO_TITLE);
而且在這兩個onCreate()
以及在onResume()
:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
仍顯示標題欄。
要求用戶選擇要啓動的應用程序很爛。 – AndroidDev 2013-08-25 07:46:06