2012-02-03 68 views
0

我收到一條消息時彈出一個alertDialog。它工作正常,只要goSms不干擾。當使用goSms啓用彈出選項時,會彈出我的警報,但在go sms彈出窗口後面,並且goSms彈出窗口是透明的。在我的警報獲得焦點並實際註冊觸摸之前,我必須點擊幾次關閉按鈕。GoSms從alertDialog竊取焦點

final AlertDialog d = new AlertDialog.Builder(ctx) 
    .setTitle(title) 
    .setMessage(message) 
     .setCancelable(false) 
     .setIcon(R.drawable.ic_alert) 
     .setPositiveButton("Dismiss", new DialogInterface.OnClickListener() { 
      public void onClick(DialogInterface dialog, int id) { 
       //finish(); 
       dialog.dismiss(); 
      } 
     }) 
    .create(); 

    d.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT); 

如何讓我的alertDialog在其創建時拉焦?

回答

0

你可以嘗試給你的應用程序的廣播接收器賦予非常高的優先級值。
<意向過濾器的android:圖標= 「繪製資源」
機器人:標籤= 「字符串資源」
機器人:優先= 「HIGH_VALUE_INTEGER」>
。 。 。
</intent-filter>

要理解的是,具有高優先級的人將首先獲得該通知。

對此更多的Infor:
http://developer.android.com/guide/topics/manifest/intent-filter-element.html
http://developer.android.com/reference/android/content/BroadcastReceiver.html

+0

goSms都有自己的優先級設置的最高數量的可能。自從我開始在這個應用程序上工作以來,我一直在作戰。我遇到的每一個問題似乎都與他們的高度優先考慮有關。 – r2DoesInc 2012-02-03 20:39:54