fixed 'leaky' dialog box error

svn:r24717
This commit is contained in:
Nathan Freitas 2011-05-03 06:41:34 +00:00
parent ae7738338d
commit bc48d8f1cc
2 changed files with 19 additions and 13 deletions

View File

@ -248,6 +248,12 @@ public class Orbot extends Activity implements OnLongClickListener, TorConstants
protected void onPause() {
super.onPause();
if (progressDialog != null)
{
progressDialog.dismiss();
progressDialog = null;
}
}
@ -472,12 +478,9 @@ public class Orbot extends Activity implements OnLongClickListener, TorConstants
}
}
private AlertDialog aDialog = null;
private void showAlert(String title, String msg, boolean button)
{
if (aDialog != null)
aDialog.dismiss();
AlertDialog aDialog = null;
if (button)
{
@ -496,6 +499,7 @@ public class Orbot extends Activity implements OnLongClickListener, TorConstants
.setMessage(msg)
.show();
}
}
/*
* Set the state of the running/not running graphic and label
@ -515,6 +519,7 @@ public class Orbot extends Activity implements OnLongClickListener, TorConstants
{
imgStatus.setImageResource(R.drawable.toron);
if (progressDialog != null)
{
progressDialog.dismiss();
@ -544,9 +549,11 @@ public class Orbot extends Activity implements OnLongClickListener, TorConstants
showAlert(getString(R.string.status_activated),getString(R.string.connect_first_time),true);
}
if (mItemOnOff != null)
mItemOnOff.setTitle(R.string.menu_stop);
}
else if (torStatus == STATUS_CONNECTING)
{

View File

@ -600,14 +600,13 @@ public class TorService extends Service implements TorServiceConstants, Runnable
else
{
TorTransProxy.purgeIptables(this);
showAlert("Status", "Transparent proxying DISABLED");
showAlert("Status", "Transparent proxying: DISABLED");
}
}
else
{
TorTransProxy.purgeIptables(this);
showAlert("Status", "Transparent proxying DISABLED");
showAlert("Status", "Transparent proxying: DISABLED");
}