I have an alertDialog that pops up when a message is received. It works fine, as long as goSms doesnt interfere. When the popup option is enabled with goSms, my alert pops up, but behind the go sms popup, and the goSms popup is transparent. I have to tap the dismiss button a few times before my alert obtains focus and actually registers the touch.
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);
How can I get my alertDialog to pull focus when its created?
you can try to give a very high valu of priority to your broadcast receiver of your app.
< intent-filter android:icon=”drawable resource”
android:label=”string resource”
android:priority=”HIGH_VALUE_INTEGER” >
. . .
< /intent-filter>
Thing to understand is that one with the high priority will get access to that notification first.
More infor regarding this :
http://developer.android.com/guide/topics/manifest/intent-filter-element.html
http://developer.android.com/reference/android/content/BroadcastReceiver.html