I have another problem I ran into with my alertDialog
, when I force close my application on the emulator or on a device, and when I go to the apps on that device or emulator to launch my application again my alertDialog
shows. I had a similar problem to this not to long ago in this link Shared Prefence for alert dialog is making my application non responsive and I thought all my issues where solved once and for all. So can someone please assist me with this issue.
final SharedPreferences settings = getSharedPreferences("pref_name", 0);
("installed", false);
final AlertDialog.Builder alertDialog = new AlertDialog.Builder(this);
alertDialog.setTitle("Title");
alertDialog.setIcon(R.drawable.ic_launcher);
alertDialog.setAdapter(new MyAdapter(), null);
alertDialog.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
SharedPreferences.Editor editor = settings.edit();
editor.putBoolean("installed", true);
editor.commit();
}
});
alertDialog.show();
Please let me know if you need me to elaborate more