Vous pouvez utiliser SYSTEM_ALERT_WINDOW à partir de votre BroadcastReceiver pour afficher une boîte de dialogue qui s'affichera au-dessus de toutes les autres applications.
Ajoutez d'abord la permission
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
dans Manifest, puis dans votre onReceiver
, Créer un AlertDialog comme suit
@Override
public void onReceive(final Context context, Intent intent) {
AlertDialog.Builder builder = new AlertDialog.Builder(context.getApplicationContext());
LayoutInflater inflater = LayoutInflater.from(context);
View dialogView = inflater.inflate(R.layout.your_dialog_layout, null);
builder.setView(dialogView);
final AlertDialog alert = builder.create();
alert.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
alert.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
alert.show();
WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
Window window = alert.getWindow();
lp.copyFrom(window.getAttributes());
//This makes the dialog take up the full width
lp.width = WindowManager.LayoutParams.MATCH_PARENT;
lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
window.setAttributes(lp);
}
Cela pourrait vous aider http://stackoverflow.com/quest ions/25921960/gcm-intentservice-comment-afficher-une-pop-up-on-notification-receive – Arshad