fdroiddata/metadata/com.seb.SLWP/handle-no-market.patch

24 lines
906 B
Diff
Raw Normal View History

diff --git a/src/com/seb/SLWP/Prefs.java b/src/com/seb/SLWP/Prefs.java
index 900ff3d..9a1691f 100755
--- a/src/com/seb/SLWP/Prefs.java
+++ b/src/com/seb/SLWP/Prefs.java
@@ -75,11 +75,17 @@ public class Prefs extends PreferenceActivity implements
bg.setOnPreferenceChangeListener(this);
initMapList();
Button bt = (Button) findViewById(R.id.bt_donate);
+ final PreferenceActivity myact = this;
bt.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
- startActivity(new Intent(Intent.ACTION_VIEW, Uri
+ try {
+ startActivity(new Intent(Intent.ACTION_VIEW, Uri
.parse("market://search?q=pub:unixseb")));
+ } catch (Exception e) {
+ Log.e("SLWP", "Cannot open 'market:' link", e);
+ Toast.makeText(myact, "Cannot launch Market", Toast.LENGTH_SHORT).show();
+ }
}
});
Button bth = (Button) findViewById(R.id.bt_help);