OSDN Git Service

Taskbar 2.0.3
authorBraden Farmer <farmerbb@gmail.com>
Sat, 15 Oct 2016 15:35:47 +0000 (09:35 -0600)
committerBraden Farmer <farmerbb@gmail.com>
Sat, 15 Oct 2016 15:35:47 +0000 (09:35 -0600)
• Add missing try/catches for startActivity()
• Minor string changes

app/build.gradle
app/src/main/java/com/farmerbb/taskbar/activity/ContextMenuActivity.java
app/src/main/java/com/farmerbb/taskbar/activity/DummyActivity.java
app/src/main/res/values-ja/strings.xml
app/src/main/res/values/strings.xml

index eca487c..adcdfe1 100644 (file)
@@ -14,7 +14,7 @@ android {
         minSdkVersion 21
         targetSdkVersion 24
 
-        versionCode 83
+        versionCode 84
         versionName "2.0.3"
 
         resConfigs "en", "ja"
index 3ee01f2..1683475 100644 (file)
@@ -18,6 +18,7 @@ package com.farmerbb.taskbar.activity;
 import android.annotation.SuppressLint;
 import android.annotation.TargetApi;
 import android.app.ActivityOptions;
+import android.content.ActivityNotFoundException;
 import android.content.ComponentName;
 import android.content.Intent;
 import android.content.SharedPreferences;
@@ -261,7 +262,10 @@ public class ContextMenuActivity extends PreferenceActivity implements Preferenc
                     intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
 
                 startFreeformActivity();
-                startActivity(intent);
+
+                try {
+                    startActivity(intent);
+                } catch (ActivityNotFoundException e) { /* Gracefully fail */ }
 
                 showStartMenu = false;
                 shouldHideTaskbar = true;
@@ -275,7 +279,10 @@ public class ContextMenuActivity extends PreferenceActivity implements Preferenc
                     startActivity(intent2);
                 } else {
                     startFreeformActivity();
-                    startActivity(new Intent(Intent.ACTION_DELETE, Uri.parse("package:" + getIntent().getStringExtra("package_name"))));
+
+                    try {
+                        startActivity(new Intent(Intent.ACTION_DELETE, Uri.parse("package:" + getIntent().getStringExtra("package_name"))));
+                    } catch (ActivityNotFoundException e) { /* Gracefully fail */ }
                 }
 
                 showStartMenu = false;
index da03a34..71bff53 100644 (file)
@@ -47,9 +47,11 @@ public class DummyActivity extends Activity {
         else {
             shouldFinish = true;
 
-            if(getIntent().hasExtra("uninstall"))
-                startActivity(new Intent(Intent.ACTION_DELETE, Uri.parse("package:" + getIntent().getStringExtra("uninstall"))));
-            else if(getIntent().hasExtra("device_admin")) {
+            if(getIntent().hasExtra("uninstall")) {
+                try {
+                    startActivity(new Intent(Intent.ACTION_DELETE, Uri.parse("package:" + getIntent().getStringExtra("uninstall"))));
+                } catch (ActivityNotFoundException e) { /* Gracefully fail */ }
+            } else if(getIntent().hasExtra("device_admin")) {
                 Intent intent = new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN);
                 intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, new ComponentName(this, LockDeviceReceiver.class));
                 intent.putExtra(DevicePolicyManager.EXTRA_ADD_EXPLANATION, getString(R.string.device_admin_description));
index b509055..b8e73cf 100644 (file)
     <string name="already_blacklisted">%1$s can\'t be selected because it is on the hidden apps list</string>
     <string name="already_top_app">%1$s can\'t be selected because it is on the top apps list</string>
 
-    <string name="alt_button_config">Alternate position for collapse button</string>
+    <string name="alt_button_config">Alternative position for collapse button</string>
     <string name="pref_title_open_in_fullscreen">Open windows from fullscreen apps</string>
     <string name="pref_description_open_in_fullscreen">Requires freeform mode to be initiated at least once after Taskbar starts. When unchecked, freeform windows will only open while in the freeform workspace.</string>
     <string name="pref_title_save_window_sizes">Save window sizes for apps</string>
index a802e54..86d8b9c 100644 (file)
     <string name="already_blacklisted">%1$s can\'t be selected because it is on the hidden apps list</string>
     <string name="already_top_app">%1$s can\'t be selected because it is on the top apps list</string>
 
-    <string name="alt_button_config">Alternate position for collapse button</string>
+    <string name="alt_button_config">Alternative position for collapse button</string>
     <string name="pref_title_open_in_fullscreen">Open windows from fullscreen apps</string>
     <string name="pref_description_open_in_fullscreen">Requires freeform mode to be initiated at least once after Taskbar starts. When unchecked, freeform windows will only open while in the freeform workspace.</string>
     <string name="pref_title_save_window_sizes">Save window sizes for apps</string>