Skip to content

Commit 4676bfc

Browse files
Attempt to fix intermittent crash
1 parent d18babf commit 4676bfc

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

README.MD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ AndroidManifest.xml is automatically updated to use the new MainActivity.
2121
Based on cordova-android-fragments (https://github.com/rajivnarayana/CordovaFragments)
2222

2323
# History
24+
## 0.0.5
25+
- Attempt to avoid crash only seen on Galaxy J1 Ace (5.1.1)
26+
2427
## 0.0.4
2528
- Experimental support for cordova-android 7
2629
- Increased dependency versions

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cordova-plugin-android-fragmentactivity",
3-
"version": "0.0.4",
3+
"version": "0.0.5",
44
"description": "An android plugin that provides a replacement activity to the default activity to start a cordova application with MainActivity as a Fragment Activity. Useful when you want to add native views on top of cordova webview.",
55
"cordova": {
66
"id": "cordova-plugin-android-fragmentactivity",

plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="cordova-plugin-android-fragmentactivity" version="0.0.4">
2+
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="cordova-plugin-android-fragmentactivity" version="0.0.5">
33

44
<name>Cordova Android FragmentActivity Plugin</name>
55
<description>An android plugin that provides a replacement activity to the default activity to start a cordova application with MainActivity as a Fragment Activity. Useful when you want to add native views on top of cordova webview.</description>

src/android/uk/co/reallysmall/cordova/plugin/fragment/CordovaFragment.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -317,15 +317,17 @@ public void onStart() {
317317
/**
318318
* The final call you receive before your activity is destroyed.
319319
*/
320-
@Override
321-
public void onDestroy() {
322-
LOG.d(TAG, "CordovaActivity.onDestroy()");
323-
super.onDestroy();
324-
325-
if (this.appView != null) {
326-
appView.handleDestroy();
327-
}
328-
}
320+
@Override
321+
public void onDestroy() {
322+
LOG.d(TAG, "CordovaActivity.onDestroy()");
323+
if (getActivity() != null) {
324+
super.onDestroy();
325+
}
326+
327+
if (this.appView != null) {
328+
appView.handleDestroy();
329+
}
330+
}
329331

330332
@Override
331333
public void startActivityForResult(Intent intent, int requestCode) {

0 commit comments

Comments
 (0)