Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/org/adblockplus/android/updater/UpdaterActivity.java

Issue 5697499218051072: Usage of new API, cleanups (reduced) (Closed)
Patch Set: Adressed first batch of review issues. Created April 16, 2014, 5:36 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
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))
+ .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();
}
}
}
-
}
« no previous file with comments | « src/org/adblockplus/android/updater/AlarmReceiver.java ('k') | src/org/adblockplus/android/updater/UpdaterService.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld