24104

Why is my intent not working?

Question:

I'm trying to get the Equalizer intent work on my app, I call my system's built in equalizer like this:

Intent intent = new Intent(); intent.setAction("android.media.action.DISPLAY_AUDIO_EFFECT_CONTROL_PANEL"); if ((intent.resolveActivity(getPackageManager()) != null)) { // here is the changes // REQUEST_CODE is an any integer value startActivityForResult(intent, 0); } else { Toast.makeText(getBaseContext(), "device not supported", Toast.LENGTH_LONG).show(); }

The problem in my code is that it is opening, however, it doesn't change the audio quality at all. No matter how much I fiddle with the knobs, sound remains the same.

Spottily also does the same, they are not using any class because the interface of equalizer changes with respect to Android Version.

What did i miss?

Answer1:

In the manifest have you added the needed permissions:

<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

Check the following manifest as example: <a href="https://android.googlesource.com/platform/packages/apps/MusicFX/+/f2f3fcd148769c5189c0d41c6ca85a8f14e6b534/AndroidManifest.xml" rel="nofollow">link</a>

Have you also tried to request the permissions see the following link (<a href="https://developer.android.com/training/permissions/requesting.html" rel="nofollow">https://developer.android.com/training/permissions/requesting.html</a>)

Answer2:

<blockquote>

Add this to your activity in your minifest to open default equlizer

</blockquote> <activity android:name=".YourActivity"> <intent-filter> <action android:name="android.media.action.DISPLAY_AUDIO_EFFECT_CONTROL_PANEL" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.CATEGORY_CONTENT_MUSIC" /> </intent-filter> </activity>

Recommend

  • Android sms intent bundle toast info not updating
  • How do I add R drawable android?
  • onItemSelected listener
  • Retrieve RSS feed and display it in text view
  • how to get item from ListView
  • broadcast receiver inside activity
  • Sending the same SMS twice
  • Android VideoView Quality is so bad on TV Box using Vitamio Library
  • Unable to retrieve number before incoming call in marshmallow
  • IllegalStateException “System services not available to Activities before onCreate()”
  • Java, will (low + high) >>> 1 overflow?
  • PyYaml parses '9:00' as int
  • How to escape colon (:) character while executing native SQL queries against an Informix database us
  • how to pass value from asp.net server control using jQuery?
  • Deliberately simplifying fractional exponents
  • How are 32 bit JavaScript numbers resulting from a bit-wise operation converted back to 64 bit numbe
  • JsonMappingException: Can not deserialize instance of java.lang.Integer out of START_OBJECT token
  • VB.Net Double comparison after some additions
  • C++ and JS RegEx equivalent of \\p{L}
  • Return null in boolean to checkbox state converter in XAML
  • Azure table query partial partitionkey guid match
  • Upper limits for fibonnacci
  • Smack 4.1.0 android Roster not displaying
  • SIP API media codecs
  • Need code translation from VB to C#
  • Does Apportable support to build library binary (.a/.so)?
  • Android cannot disable cut copy paste
  • Eclipse MTJ doesn't see Java ME SDK 3.0 devices
  • blade.php method outputting it's result to the form
  • Z3: Convert between FP and BitVector?
  • Date Conversion from yyyy-mm-dd to dd-mm-yyyy
  • Counter field in MS Access, how to generate?
  • Sony Xperia Z Tablet not found by adb
  • javascript inside java/jsp code
  • Sending data from AppleScript to FileMaker records
  • Can I make an Android app that runs a web view in Chrome 39?
  • Convert array of 8 bytes to signed long in C++
  • KeystoneJS: Relationships in Admin UI not updating
  • AngularJs get employee from factory
  • Load html files in TinyMce