cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From riknoll <>
Subject [GitHub] cordova-plugin-media pull request: Protect setVolume call in case ...
Date Tue, 19 Apr 2016 21:59:34 GMT
Github user riknoll commented on the pull request:
    @fafaman that does sound like a `configChanges` issue as Nikhil mentioned. To prevent
the restart, you need to add the `uiMode` value in the `configChanges` attribute of the Activity
declaration in AndroidManifest.xml where we declare [the rest of them](
You will find that file in the platforms folder of your project:
    The best way to make that change is by using a hook or a plugin (we recommend that you
don't edit any files in the platform directory directly).
    If you want to actually respond to that event (e.g. to change your UI to a car-friendly
UI), you'll need to make a plugin that surfaces it to the javascript. We provide a [callback](
to plugins for configuration changes so that would be pretty simple but would require Java
    A note about the implications of making that change:
    By default, Android just restarts the activity when a configuration changes because that
is the easiest way to ensure that all of the resources and other things that need to be swapped
out will automatically be taken care of by the OS. Cordova already handles some configurations,
like orientation changes. Adding that `uiMode` value will prevent the restart in this scenario,
but means that any changes that need to happen because of the configuration change won't happen
automatically. I don't really have a way of testing the implications of that so I honestly
can't say if there is any issue with adding it. You'll need to test it for yourself to make
sure nothing weird happens in that scenario.
    Read more about configuration changes [here](

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message