je veux Popup dialogue à un moment précis dans toutes les applications mon code:Fenêtre popup dans toutes les applications
public class testPOPDialog extends Activity {
/** Called when the activity is first created. */
private Handler mHandler = new Handler();
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mHandler.postDelayed(mUpdateTimeTask, 1000);
}
private Runnable mUpdateTimeTask = new Runnable() {
public void run() {
AlertDialog d = new AlertDialog.Builder(testPOPDialog.this)
.setTitle("tanchulai")
.setMessage("bucuo de tanchulai")
.create();
d.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
d.show();
}
};
}
il me donne
12-03 10:12:18.162: ERROR/AndroidRuntime(571): android.view.WindowManager$BadTokenException: Unable to add window [email protected] -- permission denied for this window type
ce qui est cette autorisation si je supprime d.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
mon l'application est correcte .....
hey, vous êtes incroyable ça marche ... – Piyush
merci beaucoup pour votre réponse – pengwang
la connaissance d'or. – Salim