feat: Add onConfigurationChanged() handling to the Android capacitor plugin infrastructure
See original GitHub issueFeature Request
Add onConfigurationChanged() handling to the Android capacitor plugin infrastructure
Description
Sometimes it is appropriate to handle the Android’s “onConfigurationChanged()” events in plugins. As of now the infrastructure does not support the feature, so a plugin cannot react to the configuration change events on Android platform.
Platform(s)
Android
Preferred Solution
Add the following handler to Plugin.java and support it in the Capacitor (like handleOnStart()):
/**
* Handle handleOnConfigurationChanged
*/
protected void handleOnConfigurationChanged() {}
Alternatives
None
Additional Context
None
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Implementing for Android - Capacitor
Open MainActivity.java and add an onCreate() method where we can register the plugin: package io.ionic.cap.plugin; import android.os.Bundle;
Read more >Handling Screen Orientation Changes in Capacitor Apps
This tutorial discusses how to handle screen orientation changes on capacitor based Android and iOS apps. Fundamentals of an Ionic App.
Read more >Ionic6 Capacitor: After adding "cordova-plugin-advanced-http ...
Go to this location on your file explorer <android\capacitor-cordova-android-plugins\ ... PathHandler getPathHandler() { return handler; } }.
Read more >Take Control of Your Capacitor App State - Ionic Blog
In this tutorial we will explore all features of the plugin to control our state, catch events like the Android back button or...
Read more >capacitor-plugin-playlist - npm
Will probably be published as @dwbn/capacitor-playlist. A capacitor plugin for Android, iOS and Web with native support for audio playlists, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The actual reason I opened this feature request is that I need it for my ionic plugin. The second thought was that there is no reason why the other hooks are implemented and this one is not.
@wf9a5m75 I have a PR up for this and it should make it into 3.0.0-alpha.8.