Hi All
So I have a fairly simple droid app.
Part of it is a waterfall of alertdialog boxes makeing sure everything
is ready to show the final display.
Example
Check GPS
If (no GPS){
alert.show}
The alert has one button that first dismisses the dialog, then
performs the check again, and displays another dialog box if GPS is
still not enabled.
This all works great if I go at a normal pace.
But if I button mash the alert dialog button, eventually I get many
alert dialog buttons on top of each other.
The program still works, ya just gotta close all of them.
Here is some example
gps_init_alt_bld = new AlertDialog.Builder(this);
gps_init_alt_bld.setMessage("GPS Not Initialized Yet.")
.setCancelable(false)
.setPositiveButton("Check GPS Status Again.", new
DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// Action for 'Yes' Button
if (latitude == 0 || longitude == 0)
{
gps_initialized=false;
gps_init_alert = gps_init_alt_bld.create();
// Title for AlertDialog
gps_init_alert.setTitle("GPS Is Needed!");
// Icon for AlertDialog
gps_init_alert.setIcon(R.drawable.icon);
try{
gps_init_alert.show();
}
catch(Exception eeee){
//Log.d("alert","Could NOTTTT THROW INIT
ALERT2");
}
}
else
{
gps_initialized=true;
dialog.dismiss();
onStart();
}
}
});
gps_init_alert = gps_init_alt_bld.create();
//Title for AlertDialog
gps_init_alert.setTitle("GPS Is Needed!");
//Icon for AlertDialog
gps_init_alert.setIcon(R.drawable.icon);
//Log.d("POSITION", "Staring Check Init");
if (latitude == 0 || longitude == 0)
{
gps_initialized=false;
try{
gps_init_alert.show();
}
catch(Exception eeeeee){
//Log.d("alert","Could NOTTTT THROW INIT ALERT");
}
}
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en