Permalink
Browse files

Fixing image resources to not force close 1.5

  • Loading branch information...
1 parent e07df2e commit 87b5d05dc27374ad0857a29d6b9928377f04caac @fkautz fkautz committed Nov 28, 2011
File renamed without changes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
@@ -4,6 +4,7 @@
import java.util.concurrent.Executors;
import android.app.ListActivity;
+import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
@@ -12,6 +13,7 @@
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
+import android.widget.Toast;
public abstract class HackerDojoActivity extends ListActivity implements
OnClickListener {
@@ -81,6 +83,10 @@ private void openNavigation() {
Intent intent = new Intent(
Intent.ACTION_VIEW,
Uri.parse("google.navigation:q=140%20whisman%20rd%2C%20mountain%20view%2C%20ca"));
- startActivity(intent);
+ try {
+ startActivity(intent);
+ } catch(ActivityNotFoundException ex) {
+ Toast.makeText(this, "No navigation app detected", Toast.LENGTH_SHORT).show();
+ }
}
}

0 comments on commit 87b5d05

Please sign in to comment.