husaindevelop

husaindevelop

Clipboard readtext not working in android webview

Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext function. It works just fine in mobile chrome, but in android webview, which is again based on chromium engine, it just does not work.

We have given all permission in android manifest

<uses-permission android:name="android.permission.READ_CLIPBOARD" />
<uses-permission android:name="android.permission.WRITE_CLIPBOARD" />
<uses-permission android:name="android.webkit.PermissionRequest" />
 ClipData clipData = clipboard.getPrimaryClip();
                    ClipData.Item item1 = clipData.getItemAt(0);
                    String text = item1.getText().toString();

webView.evaluateJavascript("(function(){document.activeElement.value = '"+text+"'})()",
                            new ValueCallback<String>() {
                                @Override
                                public void onReceiveValue(String value) {

                                }
                            });

But we are unable to get the paste menu on long press inside textarea just like whatsapp. Guide us as where we are going wrong.

Popular Android topics Top

New
PragmaticBookshelf
Google Android dominates the mobile market, and by targeting Android, your apps can run on most of the phones and tablets in the world. T...
New
New
AndroidMan
I’ve tried signing up for Airnow as I used to do very well when they were Airpush, but i haven’t used them in years. I went through the s...
New
tauseeqafzal
Question: Android Developer → is there any way to read the .trash directory? → we can copy or save the file before delete ? #android...
New
cajasigwe
Hi, Please I need help to get DHIS2 Capture working in Android Tablet Phone desk ( KT5-3C) Android Version: 10. Build: KT5-3C_LTE05M0_K...
New
tunelabguy
I have an expensive app ($160) in the Play Store that I would like to update. I would like to do a beta test of the update with potentia...
New
sabibo
We recently switched some machines to a network that uses ipV6. Those machines are now unable to package our Unreal game for Android, du...
New
Garrett
This is a question about Android Studio. Where is the Android Studio emulator’s camera default apartment 3D model stored in Android Stud...
New
Devraj5032
I’m using TensorFlow Lite (TFLite) with React Native Expo. When I test the app using the Expo Go app, everything works fine. However, whe...
New

Other popular topics Top

Devtalk
Reading something? Working on something? Planning something? Changing jobs even!? If you’re up for sharing, please let us know what you’...
1016 16828 371
New
AstonJ
Or looking forward to? :nerd_face:
New
dasdom
No chair. I have a standing desk. This post was split into a dedicated thread from our thread about chairs :slight_smile:
New
Margaret
Hello content creators! Happy new year. What tech topics do you think will be the focus of 2021? My vote for one topic is ethics in tech...
New
AstonJ
In case anyone else is wondering why Ruby 3 doesn’t show when you do asdf list-all ruby :man_facepalming: do this first: asdf plugin-upd...
New
AstonJ
Continuing the discussion from Thinking about learning Crystal, let’s discuss - I was wondering which languages don’t GC - maybe we can c...
New
First poster: joeb
The File System Access API with Origin Private File System. WebKit supports new API that makes it possible for web apps to create, open,...
New
husaindevelop
Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
New
PragmaticBookshelf
Author Spotlight: Peter Ullrich @PJUllrich Data is at the core of every business, but it is useless if nobody can access and analyze ...
New
First poster: bot
zig/http.zig at 7cf2cbb33ef34c1d211135f56d30fe23b6cacd42 · ziglang/zig. General-purpose programming language and toolchain for maintaini...
New

Latest in Android

View all threads ❯