0

In my preference activity I have one preference that links to a website (eg. stackoverflow.com). The code works fine in everything EXCEPT a Google TV emulator. On the Google TV emulator clicking the preference creates a Force Close.

Log Cat says "02-21 12:13:59.684: E/AndroidRuntime(1993): 
  android.content.ActivityNotFoundException: No Activity found to handle
  Intent { act=android.intent.action.VIEW dat=http://www.stackoverflow.com }

Here is my code that I'm using...

getPreferenceManager().findPreference("pref_visit_web").setOnPrndeferenceClickListener(new OnPreferenceClickListener() {
  @Override
  public boolean onPreferenceClick(Preference preference)     {

        Intent v = new Intent(Intent.ACTION_VIEW);
        v.setData(Uri.parse("http://www.stackoverflow.com"));
    startActivity(v);


        return false;
  } 
});
Mat
  • 202,337
  • 40
  • 393
  • 406
Mel
  • 6,214
  • 10
  • 54
  • 71

1 Answers1

0

Sorry. Chrome is not installed on the Google TV Emulator (and there is therefore no browser available to handle that intent) [at least as of now].

It should work on a real device though.

yydl
  • 24,284
  • 16
  • 65
  • 104
  • Thankyou, here is a related question... http://stackoverflow.com/questions/8209387/google-tv-emulator-without-chrome-browser – Mel Mar 06 '12 at 10:39