
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

How did they do? Which language did you use? Any tips?
New

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

Start building native Android apps the modern way in Kotlin with Jetpack's expansive set of tools, libraries, and best practices. Learn h...
New

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

Question: Android Developer
→ is there any way to read the .trash directory?
→ we can copy or save the file before delete ?
#android...
New

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

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

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

This is a question about Android Studio.
Where is the Android Studio emulator’s camera default apartment 3D model stored in Android Stud...
New

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

Reading something? Working on something? Planning something? Changing jobs even!?
If you’re up for sharing, please let us know what you’...
New

New

No chair. I have a standing desk.
This post was split into a dedicated thread from our thread about chairs :slight_smile:
New

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

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

Continuing the discussion from Thinking about learning Crystal, let’s discuss - I was wondering which languages don’t GC - maybe we can c...
New

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

Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
New

Author Spotlight:
Peter Ullrich
@PJUllrich
Data is at the core of every business, but it is useless if nobody can access and analyze ...
New

zig/http.zig at 7cf2cbb33ef34c1d211135f56d30fe23b6cacd42 · ziglang/zig.
General-purpose programming language and toolchain for maintaini...
New
Latest in Android
Latest (all)
Categories:
Popular Portals
- /elixir
- /opensuse
- /rust
- /kotlin
- /ruby
- /erlang
- /python
- /react
- /clojure
- /quarkus
- /go
- /react-native
- /vapor
- /v
- /wasm
- /django
- /security
- /nodejs
- /centos
- /rails
- /haskell
- /fable
- /swift
- /gleam
- /deno
- /js
- /tailwind
- /laravel
- /assemblyscript
- /symfony
- /phoenix
- /crystal
- /typescript
- /debian
- /adonisjs
- /julia
- /arch-linux
- /svelte
- /spring
- /c-plus-plus
- /preact
- /flutter
- /actix
- /java
- /angular
- /ocaml
- /kubuntu
- /zig
- /scala
- /zotonic
- /vim
- /rocky
- /lisp
- /keyboards
- /html
- /emacs
- /nim
- /vuejs
- /nerves
- /elm