For information, here the StackTrace (GS3 4.0.4):

W/System.err(15399): android.content.ActivityNotFoundException: No Activity 
found to handle Intent { act=android.intent.action.MAIN 
cat=[android.intent.category.LAUNCHER] sel={act=android.intent.action.MAIN 
cat=[android.intent.category.APP_MUSIC]} }

Le mardi 25 septembre 2012 11:16:53 UTC+2, Alex a écrit :
>
> How can I open music player on Samsung Galaxy S3 (4.0.4 API15) ?
> I tried this code which works fine on any other devices but not in GS3 :
>
> try {
>     try {
>         // 8 <= API < 15
>         String action = (String) 
> MediaStore.class.getDeclaredField("INTENT_ACTION_MUSIC_PLAYER").get(null);
>         Intent intent = new Intent(action);
>         startActivity(intent);
>     } catch(Exception e) {
>         // 15 <= API
>         String category = (String) 
> Intent.class.getDeclaredField("CATEGORY_APP_MUSIC").get(null);
>         Method method = Intent.class.getMethod("makeMainSelectorActivity", 
> String.class, String.class);
>         Intent intent = (Intent) method.invoke(null, Intent.ACTION_MAIN, 
> category);
>         startActivity(intent);
>     }
> catch(Exception e) {
>     // music player not found
> }
>
> http://stackoverflow.com/questions/12532207/open-music-player-on-galaxy-s3
>
>

-- 
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

Reply via email to