Determine if a specific activity in an application can be launched...

Posted by Justin on Stack Overflow See other posts from Stack Overflow or by Justin
Published on 2010-06-09T01:50:29Z Indexed on 2010/06/09 1:52 UTC
Read the original article Hit count: 285

Applications can have any number of launchable activities. I know how to get the list of these activities via PackageManager.

Is there a way to determine which activities can be launched via startActivity?

For example, the Documents To Go app has different activities that will start Word, Excel, Powerpoint, PDF, etc... I am able to launch all o these just fine.

However, it also contains some activities that I am not able to launch with startActivity... If I attempt to do this I get a SecurityException.

I want to be able to determine which activities I can safely launch and which I cannot so I only present the user with a list of activities that I can safely launch from within my application...

Is this possible?

© Stack Overflow or respective owner

Related posts about android

Related posts about activity