I know how to update my own programs, and I know how to open programs using the a predefined Uri (for sms or email for example)
I need to know how I can create an Intent to open MyTracks or any other application that I don't know what intents they listen to.
I got this info from DDMS, but I havn't been succesful in turning this to an Intent I can use. This is taken from when opening MyTracks manually.
Thanks for your help
05-06 11:22:24.945: INFO/ActivityManager(76): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.google.android.maps.mytracks/com.google.android.apps.mytracks.MyTracks bnds=[243,338][317,417] }
05-06 11:22:25.005: INFO/ActivityManager(76): Start proc com.google.android.maps.mytracks for activity com.google.android.maps.mytracks/com.google.android.apps.mytracks.MyTracks: pid=1176 uid=10063 gids={3003, 1015}
05-06 11:22:26.995: INFO/ActivityManager(76): Displayed activity com.google.android.maps.mytracks/com.google.android.apps.mytracks.MyTracks: 1996 ms (total 1996 ms)
If you're attempting to start a SERVICE rather than activity, this worked for me:
If you use the intent.setComponent(...) method as mentioned in other answers, you may get an "Implicit intents with startService are not safe" warning.
I have work it like this,
Example usage:
Hope it helps someone.
If you already have the package name you wish to activate, you can use the following code which is a bit more generic:
I found that it works better for cases where the main activity was not found by the regular method of start the MAIN activity.
This is the code of my solution base on MasterGaurav solution:
You can use this command to find the package names installed on a device:
Reference: http://www.aftvnews.com/how-to-determine-the-package-name-of-an-android-app/
// This works on Android Lollipop 5.0.2