File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
src/main/java/com/owncloud/android/ui/activity Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 3535import android .os .Build ;
3636import android .os .Bundle ;
3737import android .text .TextUtils ;
38+ import android .view .KeyEvent ;
3839import android .view .View ;
3940import android .webkit .JavascriptInterface ;
4041import android .webkit .ValueCallback ;
@@ -418,6 +419,15 @@ public void fileRename(String renameString) {
418419 Log_OC .e (this , "Failed to parse rename json message: " + e );
419420 }
420421 }
422+
423+ @ JavascriptInterface
424+ public void paste () {
425+ // Javascript cannot do this by itself, so help out.
426+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .N ) {
427+ webview .dispatchKeyEvent (new KeyEvent (KeyEvent .ACTION_DOWN , KeyEvent .KEYCODE_PASTE ));
428+ webview .dispatchKeyEvent (new KeyEvent (KeyEvent .ACTION_UP , KeyEvent .KEYCODE_PASTE ));
429+ }
430+ }
421431 }
422432
423433
You can’t perform that action at this time.
0 commit comments