I’d like to be able to launch the default RSS reader from my application. Essentially, what we need is for the user to be able to press a button and the RSS reader is launched.
I believe the best way to do this would be with an implicit intent, but I’m not sure what code to use for the RSS reader.
I did something similar for contacts…
Intent contacts = new Intent();
contacts.setAction(android.content.Intent.ACTION_VIEW);
contacts.setData(Contacts.CONTENT_URI);
startActivity(contacts);
But I’m not sure what syntax to use for the RSS reader. Any help would be greatly appreciated.
I doubt that there is a “default RSS reader” on many Android devices.
That being said, use
setDataAndType(), supplying the MIME type of the feed in question (e.g.,application/rss+xml), then hope for the best.ACTION_VIEWis as good a guess as any for an action to try.You will then want to either catch the
ActivityNotFoundExceptionto let the user know there was no such activity, or usePackageManagerto determine if there is a possible activity in the first place before callingstartActivity().