[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] r24717: {projects} fixed 'leaky' dialog box error (in projects/android/trunk/Orbot/src/org/torproject/android: . service)



Author: n8fr8
Date: 2011-05-03 06:41:34 +0000 (Tue, 03 May 2011)
New Revision: 24717

Modified:
   projects/android/trunk/Orbot/src/org/torproject/android/Orbot.java
   projects/android/trunk/Orbot/src/org/torproject/android/service/TorService.java
Log:
fixed 'leaky' dialog box error


Modified: projects/android/trunk/Orbot/src/org/torproject/android/Orbot.java
===================================================================
--- projects/android/trunk/Orbot/src/org/torproject/android/Orbot.java	2011-05-03 05:58:58 UTC (rev 24716)
+++ projects/android/trunk/Orbot/src/org/torproject/android/Orbot.java	2011-05-03 06:41:34 UTC (rev 24717)
@@ -248,6 +248,12 @@
 	protected void onPause() {
 		super.onPause();
 		
+		if (progressDialog != null)
+		{
+			progressDialog.dismiss();
+			progressDialog = null;
+		}
+		
 
 	}
 
@@ -472,21 +478,18 @@
 		}
 	}
 	
-	private AlertDialog aDialog = null;
-	
 	private void showAlert(String title, String msg, boolean button)
 	{
-		if (aDialog != null)
-			aDialog.dismiss();
+		AlertDialog aDialog = null;
 		
 		 if (button)
 		 {
-			 aDialog = new AlertDialog.Builder(this)
-		 .setIcon(R.drawable.icon)
-         .setTitle(title)
-         .setMessage(msg)
-         .setPositiveButton(android.R.string.ok, null)
-         .show();
+				 aDialog = new AlertDialog.Builder(this)
+			 .setIcon(R.drawable.icon)
+	         .setTitle(title)
+	         .setMessage(msg)
+	         .setPositiveButton(android.R.string.ok, null)
+	         .show();
 		 }
 		 else
 		 {
@@ -496,6 +499,7 @@
 	         .setMessage(msg)
 	         .show();
 		 }
+	
 	}
     /*
      * Set the state of the running/not running graphic and label
@@ -515,6 +519,7 @@
 		    	{
 		    		imgStatus.setImageResource(R.drawable.toron);
 		    	
+
 		    		if (progressDialog != null)
 		    		{
 		    			progressDialog.dismiss();
@@ -544,8 +549,10 @@
 		    			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)

Modified: projects/android/trunk/Orbot/src/org/torproject/android/service/TorService.java
===================================================================
--- projects/android/trunk/Orbot/src/org/torproject/android/service/TorService.java	2011-05-03 05:58:58 UTC (rev 24716)
+++ projects/android/trunk/Orbot/src/org/torproject/android/service/TorService.java	2011-05-03 06:41:34 UTC (rev 24717)
@@ -600,14 +600,13 @@
 	 		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");
 
     	}
     	

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits