abbie abbie - 5 months ago 147
Android Question

How to open the system's built in Equalizer programmatically?

I have seen many apps opening systems in built Equalizer (google play music, Spotify, Samsung stock music player). Directly, without having to write their own from scratch. How do these apps do that? I couldn't find a solution.

} else if (id == R.id.action_fx) {
Intent intent = new Intent();
intent.setAction("android.media.action.DISPLAY_AUDIO_EFFECT_CONTROL_PANEL");
if ((intent.resolveActivity(getPackageManager()) != null)) {
startActivity(intent);
} else {
Intent intent11 = new Intent(MainActivity.this, Help.class);
intent11.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
startActivity(intent11);
// No equalizer found :(
}
return true;

Answer

The following should work to start the default equalizer Activity:

Intent intent = new Intent();
intent.setAction("android.media.action.DISPLAY_AUDIO_EFFECT_CONTROL_PANEL");
if((intent.resolveActivity(getPackageManager()) != null)) {
    startActivity(intent);
} else {
    // No equalizer found :(
}

Spotify basically does the same, haven't tested the others.

Comments