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