
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

Programmers don't just use Kotlin, they love it. Even Google has adopted it as a first-class language for Android development. With Kotli...
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

Creating your own domain specific languages (DSLs) is both challenging and exhilarating. DSLs give users a way to interact with your appl...
New

Hi, this is my parrition informarion. A week ago I erased ‘system’ and now my hotpepper puya tablet bootloops. I have a gsi im trying to...
New

Dear Sir,
I am a beginner in Android App development and I am currently trying to establish a connection between my Android Studio Java ...
New

I’m a developer working as a contractor for a company. I’m finding it confusing on how I should answer these questions? Has Google just b...
New

Hello
I am starting the tearning curve to writing an app for my galaxy phone.
Me and my friens play a lot of “Texas Hold-Em” and, for t...
New

Honest question, do companies still use Java for their new android apps?
I thought everybody was using Kotlin these days.
New

Old android photo name sequence
Help decoding file names
Example. I want to see if a file name aligns with a time / date in which the p...
New

There is an Android app. I just want to create two GRAPHS with CPU Runtime and Battery Consumption.
It is as simple as this.
I tried w...
New
Other popular topics

I know that these benchmarks might not be the exact picture of real-world scenario, but still I expect a Rust web framework performing a ...
New

Please tell us what is your preferred monitor setup for programming(not gaming) and why you have chosen it.
Does your monitor have eye p...
New

Bought the Moonlander mechanical keyboard. Cherry Brown MX switches. Arms and wrists have been hurting enough that it’s time I did someth...
New

Thanks to @foxtrottwist’s and @Tomas’s posts in this thread: Poll: Which code editor do you use? I bought Onivim! :nerd_face:
https://on...
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

Saw this on TikTok of all places! :lol:
Anyone heard of them before?
Lite:
New

Rails 7 completely redefines what it means to produce fantastic user experiences and provides a way to achieve all the benefits of single...
New

Author Spotlight
Rebecca Skinner
@RebeccaSkinner
Welcome to our latest author spotlight, where we sit down with Rebecca Skinner, auth...
New

Large Language Models like ChatGPT say The Darnedest Things.
The Errors They MakeWhy We Need to Document Them, and What We Have Decided ...
New

Author Spotlight:
Tammy Coron
@Paradox927
Gaming, and writing games in particular, is about passion, vision, experience, and immersio...
New
Latest in Android
Latest (all)
Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /js
- /rails
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /java
- /haskell
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /vscode
- /opensuse
- /ash
- /centos
- /php
- /deepseek
- /zig
- /scala
- /html
- /debian
- /nixos
- /lisp
- /agda
- /sublime-text
- /textmate
- /react-native
- /kubuntu
- /arch-linux
- /revery
- /ubuntu
- /manjaro
- /spring
- /django
- /diversity
- /nodejs
- /lua
- /c
- /julia
- /slackware
- /neovim