Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
Flutter Inappwebview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李增强
Flutter Inappwebview
Commits
c0c3fdee
Commit
c0c3fdee
authored
Nov 04, 2019
by
crazecoder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix crash
parent
b800d0f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
+18
-12
android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebChromeClient.java
...utter_inappbrowser/InAppWebView/InAppWebChromeClient.java
+18
-12
No files found.
android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebChromeClient.java
View file @
c0c3fdee
package
com.pichillilorenzo.flutter_inappbrowser.InAppWebView
;
import
android.annotation.TargetApi
;
import
android.content.ActivityNotFoundException
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.graphics.Bitmap
;
...
...
@@ -521,18 +522,23 @@ public class InAppWebChromeClient extends WebChromeClient implements PluginRegis
FileChooserParams
fileChooserParams
)
{
mUploadMessageArray
=
filePathCallback
;
Intent
contentSelectionIntent
=
new
Intent
(
Intent
.
ACTION_GET_CONTENT
);
contentSelectionIntent
.
addCategory
(
Intent
.
CATEGORY_OPENABLE
);
contentSelectionIntent
.
setType
(
"*/*"
);
Intent
[]
intentArray
;
intentArray
=
new
Intent
[
0
];
Intent
chooserIntent
=
new
Intent
(
Intent
.
ACTION_CHOOSER
);
chooserIntent
.
putExtra
(
Intent
.
EXTRA_INTENT
,
contentSelectionIntent
);
chooserIntent
.
putExtra
(
Intent
.
EXTRA_TITLE
,
"Image Chooser"
);
chooserIntent
.
putExtra
(
Intent
.
EXTRA_INITIAL_INTENTS
,
intentArray
);
((
inAppBrowserActivity
!=
null
)
?
inAppBrowserActivity
:
flutterWebView
.
activity
).
startActivityForResult
(
chooserIntent
,
FILECHOOSER_RESULTCODE
);
return
super
.
onShowFileChooser
(
webView
,
filePathCallback
,
fileChooserParams
);
try
{
Intent
contentSelectionIntent
=
new
Intent
(
Intent
.
ACTION_GET_CONTENT
);
contentSelectionIntent
.
addCategory
(
Intent
.
CATEGORY_OPENABLE
);
contentSelectionIntent
.
setType
(
"*/*"
);
Intent
[]
intentArray
;
intentArray
=
new
Intent
[
0
];
Intent
chooserIntent
=
new
Intent
(
Intent
.
ACTION_CHOOSER
);
chooserIntent
.
putExtra
(
Intent
.
EXTRA_INTENT
,
contentSelectionIntent
);
chooserIntent
.
putExtra
(
Intent
.
EXTRA_TITLE
,
"Image Chooser"
);
chooserIntent
.
putExtra
(
Intent
.
EXTRA_INITIAL_INTENTS
,
intentArray
);
((
inAppBrowserActivity
!=
null
)
?
inAppBrowserActivity
:
flutterWebView
.
activity
).
startActivityForResult
(
chooserIntent
,
FILECHOOSER_RESULTCODE
);
}
catch
(
ActivityNotFoundException
e
)
{
e
.
printStackTrace
();
return
false
;
}
return
true
;
}
private
MethodChannel
getChannel
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment