That Intent is okay, though there is no need for BROWSABLE. (As per the documentation, BROWSABLE means that the Intent came from an untrusted source so you want to restrict who will handle it to those that say they will protect themselves from such things.)
I'm not sure what you mean by "empty URI" -- it says "empty string", which would just be a Uri created from an empty string. On Thu, Nov 18, 2010 at 5:05 PM, jotobjects <[email protected]> wrote: > Thanks - I was afraid of that (although it is not quite blind luck). > > The user's home page would be an obvious target, but there doesn't > seem to be a non blind luck way to find the home web page. The > browser seems to bring up the last page visited which is OK since that > will be customary behavior for the user. > > I also tried this, which works but lands the user on the www.google.com > web page with "http" in the input window. Is this a valid Intent? > > Intent webIntent = new Intent(Intent.ACTION_VIEW,Uri.fromParts("http", > "", null)); > webIntent.addCategory(Intent.CATEGORY_DEFAULT); > webIntent.addCategory(Intent.CATEGORY_BROWSABLE); > > Also I do not understand this documentation for how to bring up the > web browser - > > http://developer.android.com/guide/appendix/g-app-intents.html > > The WEB_SEARCH action mentioned there with an "empty" URI sounds like > what I want, but I can't figure out how to create an "empty URI" that > works. > > > On Nov 18, 2:52 pm, Dianne Hackborn <[email protected]> wrote: > > That is a bogus Intent; it is just blind luck that it happens to only run > > into the browser as something that happens to match it, and you can't > count > > on that doing what you want anywhere else. > > > > I don't believe there is a generic action to start "the browser;" you are > > supposed to start it by asking it to view a URI. > > > > > > > > On Thu, Nov 18, 2010 at 2:39 PM, jotobjects <[email protected]> > wrote: > > > I want to invoke the internet browser app without giving it a URL to > > > open. I have tried a couple of things. What seems to work is this - > > > > > Intent webIntent = new Intent(Intent.ACTION_MAIN); > > > webIntent.addCategory(Intent.CATEGORY_LAUNCHER); > > > webIntent.addCategory(Intent.CATEGORY_DEFAULT); > > > webIntent.addCategory(Intent.CATEGORY_BROWSABLE); > > > context.startActivity(webIntent); > > > > > Is there another or better Intent to use? Is it good practice to use > > > the Launcher Intent for an app in this way? > > > > > -- > > > You received this message because you are subscribed to the Google > > > Groups "Android Developers" group. > > > To post to this group, send email to > [email protected] > > > To unsubscribe from this group, send email to > > > [email protected]<android-developers%[email protected]> > <android-developers%[email protected]<android-developers%[email protected]> > > > > > For more options, visit this group at > > >http://groups.google.com/group/android-developers?hl=en > > > > -- > > Dianne Hackborn > > Android framework engineer > > [email protected] > > > > Note: please don't send private questions to me, as I don't have time to > > provide private support, and so won't reply to such e-mails. All such > > questions should be posted on public forums, where I and others can see > and > > answer them. > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

