android equalizer crashes if library not loaded -


i trying work android equalizer works if app has been started , fails when app uses equalizer

the app crash whenever app tries access equalizer library

is there way know if equalizer available other wise not start activity

here code trying

equalizer eq = null;  if (eq != null) {                 eq.release();             }     try {             eq = new equalizer(0, 0);      }         catch (illegalstateexception e) {                 fail("equalizer not initialized");         }         catch (illegalargumentexception e) {          }          catch (unsupportedoperationexception e) {          } 

but still keep getting error

java.lang.runtimeexception: java.lang.unsupportedoperationexception: effect library not loaded

you should call release() on equalizer object when you're finished it. can't have many instance of equalizer object.

== update ==

in catch block, 1 causing issue, display toast , finish current activity :

catch (unsupportedoperationexception e) {    //display toast    finish(); } 

Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -