Skip to content

Commit

Permalink
Add method to handle onRequestPermissionsResult
Browse files Browse the repository at this point in the history
  • Loading branch information
ReallySmallSoftware committed Mar 5, 2018
1 parent 7691e3a commit ecb936c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
23 changes: 9 additions & 14 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Installation
==
# Installation
```
cordova plugin add cordova-plugin-android-fragmentactivity --save
```
Expand All @@ -10,28 +9,24 @@ or
phonegap plugin add cordova-plugin-android-fragmentactivity
```

Usage
==
# Usage
No manual configuration required.

How it works
==
# How it works
This plugin comes bundled with a CordovaFragment (which is a Fragment similar to CordovaActivity) and a MainActivity that extends AppCompatActivity and adds CordovaFragment using FragmentTransactions.

AndroidManifest.xml is automatically updated to use the new MainActivity.

Credits
==
# Credits
Based on cordova-android-fragments (https://github.com/rajivnarayana/CordovaFragments)

History
==
# History
## 0.0.3
- Added missing method to activity to handle permission request results

0.0.2
--
## 0.0.2
- Correct log message
- Add history to README

0.0.1
--
## 0.0.1
Initial release
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-android-fragmentactivity",
"version": "0.0.2",
"version": "0.0.3",
"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.",
"cordova": {
"id": "cordova-plugin-android-fragmentactivity",
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="cordova-plugin-android-fragmentactivity" version="0.0.2">
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="cordova-plugin-android-fragmentactivity" version="0.0.3">

<name>Cordova Android FragmentActivity Plugin</name>
<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>
Expand Down
6 changes: 6 additions & 0 deletions src/android/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,10 @@ public void onCreate(Bundle savedInstanceState)
ft.add(android.R.id.content, currentFragment);
ft.commit();
}

@Override
public void onRequestPermissionsResult(int requestCode, String permissions[],
int[] grantResults) {
currentFragment.onRequestPermissionsResult(requestCode,permissions,grantResults);
}
}

0 comments on commit ecb936c

Please sign in to comment.