Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Plugin: Use pluginInitialize instead of initialize #1387

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions www/docs/en/12.x/guide/platforms/android/plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,20 @@ referenced by a call from JavaScript, unless `<param>` with an `onload`
</feature>
```

Plugins should use the `initialize` method for their start-up logic.
Plugins should use `pluginInitialize` for their start-up logic.

```java
/**
* Called after plugin construction and fields have been initialized.
*/
@Override
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
super.initialize(cordova, webView);
// your init code here
protected void pluginInitialize() {
// Your code here ...
}
```

Do not use [CordovaPlugin#initialize(CordovaInterface cordova, CordovaWebView webView)](https://github.com/apache/cordova-android/blob/dff2fc633121f995b6827a9d1a211c3c54d60c7d/framework/src/org/apache/cordova/CordovaPlugin.java#L68) anylonger, as this will be deprecated in the future. `CordovaPlugin` has the public members `cordova` and `webView` which you can access in your plugin.

Plugins also have access to Android lifecycle events and can handle them
by extending one of the provided methods (`onResume`, `onDestroy`, etc).
Plugins with long-running requests, background activity such as media playback,
Expand Down
12 changes: 8 additions & 4 deletions www/docs/en/dev/guide/platforms/android/plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,20 @@ referenced by a call from JavaScript, unless `<param>` with an `onload`
</feature>
```

Plugins should use the `initialize` method for their start-up logic.
Plugins should use `pluginInitialize` for their start-up logic.

```java
/**
* Called after plugin construction and fields have been initialized.
*/
@Override
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
super.initialize(cordova, webView);
// your init code here
protected void pluginInitialize() {
// Your code here ...
}
```

Do not use [CordovaPlugin#initialize(CordovaInterface cordova, CordovaWebView webView)](https://github.com/apache/cordova-android/blob/dff2fc633121f995b6827a9d1a211c3c54d60c7d/framework/src/org/apache/cordova/CordovaPlugin.java#L68) anylonger, as this will be deprecated in the future. `CordovaPlugin` has the public members `cordova` and `webView` which you can access in your plugin.

Plugins also have access to Android lifecycle events and can handle them
by extending one of the provided methods (`onResume`, `onDestroy`, etc).
Plugins with long-running requests, background activity such as media playback,
Expand Down
Loading