 Issue 5697499218051072:
  Usage of new API, cleanups (reduced)  (Closed)
    
  
    Issue 5697499218051072:
  Usage of new API, cleanups (reduced)  (Closed) 
  | Index: src/org/adblockplus/android/updater/UpdaterActivity.java | 
| diff --git a/src/org/adblockplus/android/updater/UpdaterActivity.java b/src/org/adblockplus/android/updater/UpdaterActivity.java | 
| index 7f6f02227923d86d2269764ba0ca92391e0eb661..43fda845c3f728cd7e43e109ab831e5c172fa8d7 100644 | 
| --- a/src/org/adblockplus/android/updater/UpdaterActivity.java | 
| +++ b/src/org/adblockplus/android/updater/UpdaterActivity.java | 
| @@ -37,7 +37,7 @@ import android.view.Window; | 
| public class UpdaterActivity extends Activity | 
| { | 
| @Override | 
| - public void onCreate(Bundle savedInstanceState) | 
| + public void onCreate(final Bundle savedInstanceState) | 
| { | 
| super.onCreate(savedInstanceState); | 
| @@ -53,24 +53,28 @@ public class UpdaterActivity extends Activity | 
| return; | 
| } | 
| - new AlertDialog.Builder(this).setTitle(R.string.msg_update_available).setMessage(getString(R.string.msg_update_description)).setIcon(android.R.drawable.ic_dialog_info) | 
| - .setPositiveButton(R.string.ok, new OnClickListener() { | 
| + new AlertDialog.Builder(this).setTitle(R.string.msg_update_available).setMessage(getString(R.string.msg_update_description)) | 
| 
Felix Dahlke
2014/04/28 07:29:01
Looks like weird whitespace changes again, the cod
 
René Jeschke
2014/04/28 08:34:32
Done.
 | 
| + .setIcon(android.R.drawable.ic_dialog_info) | 
| + .setPositiveButton(R.string.ok, new OnClickListener() | 
| + { | 
| @Override | 
| - public void onClick(DialogInterface arg0, int arg1) | 
| + public void onClick(final DialogInterface arg0, final int arg1) | 
| { | 
| // Start download service | 
| startService(new Intent(UpdaterActivity.this, UpdaterService.class).putExtras(extras)); | 
| finish(); | 
| } | 
| - }).setNegativeButton(R.string.cancel, new OnClickListener() { | 
| + }).setNegativeButton(R.string.cancel, new OnClickListener() | 
| + { | 
| @Override | 
| - public void onClick(DialogInterface dialog, int which) | 
| + public void onClick(final DialogInterface dialog, final int which) | 
| { | 
| finish(); | 
| } | 
| - }).setOnCancelListener(new OnCancelListener() { | 
| + }).setOnCancelListener(new OnCancelListener() | 
| + { | 
| @Override | 
| - public void onCancel(DialogInterface dialog) | 
| + public void onCancel(final DialogInterface dialog) | 
| { | 
| finish(); | 
| } | 
| @@ -79,22 +83,21 @@ public class UpdaterActivity extends Activity | 
| // Install downloaded update | 
| else | 
| { | 
| - String file = getIntent().getStringExtra("path"); | 
| - File updateFile = new File(file); | 
| + final String file = getIntent().getStringExtra("path"); | 
| + final File updateFile = new File(file); | 
| try | 
| { | 
| - Intent installerIntent = new Intent(); | 
| + final Intent installerIntent = new Intent(); | 
| installerIntent.setAction(Intent.ACTION_VIEW); | 
| installerIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | 
| installerIntent.setDataAndType(Uri.fromFile(updateFile), "application/vnd.android.package-archive"); | 
| startActivity(installerIntent); | 
| android.os.Process.killProcess(android.os.Process.myPid()); | 
| } | 
| - catch (Exception e) | 
| + catch (final Exception e) | 
| { | 
| e.printStackTrace(); | 
| } | 
| } | 
| } | 
| - | 
| } |