Skip to content

Commit f1a41d1

Browse files
committed
fix: Wrong behavior when cancel
1 parent 0efd246 commit f1a41d1

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

android/src/main/java/com/flutter_webview_plugin/WebviewManager.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,16 @@ public boolean handleResult(int requestCode, int resultCode, Intent intent){
5353
if(Build.VERSION.SDK_INT >= 21){
5454
if(requestCode == FILECHOOSER_RESULTCODE){
5555
Uri[] results = null;
56-
if(resultCode == Activity.RESULT_OK && intent != null){
57-
String dataString = intent.getDataString();
58-
if(dataString != null){
59-
results = new Uri[]{ Uri.parse(dataString) };
60-
}else if(fileUri != null){
61-
results = new Uri[]{ fileUri };
62-
}
63-
}else{
56+
if(resultCode == Activity.RESULT_OK){
6457
if(fileUri != null){
6558
results = new Uri[]{ fileUri };
6659
}
60+
if(intent != null){
61+
String dataString = intent.getDataString();
62+
if(dataString != null){
63+
results = new Uri[]{ Uri.parse(dataString) };
64+
}
65+
}
6766
}
6867
if(mUploadMessageArray != null){
6968
mUploadMessageArray.onReceiveValue(results);

0 commit comments

Comments
 (0)