
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

I am making an app with Nativescript-vue and I would like to have an event where I click on an icon and then a new box appears. For the i...
New

I need to know how to implement outgoing call in my custom application instead of using default phone call app i need my own app call.
New

I have an android app whereby notifications will fire and immediately leave the tray. This doesn’t always happen, it’s unpredictable they...
New

I am trying to develop an app which will make your smartphone act as a “keyboard”. I need it to send different symbols to another devices...
New

Display is not working properly in landscape mode when projection given by pixel 7 version 13 in case of video play by youtube app after ...
New

Hi
Hope it is a simple question :slight_smile:
I am planning to use a new PC for making my enterprise app.
Everything works perfect, b...
New

Hello everyone, I recently started learning Kotlin and downloaded Android Studio, but after writing my first code and trying to run it, I...
New

Could you please help me to find the problem why startScan function is not executed. By debugging after @RequiresBluetoothLocationPermiss...
New

We have developed a audio/video calling functionality using opentok sdk, now we want to integrate speech recognizer for transcribing voic...
New

I’ve been hearing a lot about AI in mobile phones lately, and I’m kind of confused about how it’s different from the usual smart features...
New
Other popular topics

A PragProg Hero’s Journey with Brian P. Hogan @bphogan
Have you ever worried that your only legacy will be in the form of legacy...
New

Rust is an exciting new programming language combining the power of C with memory safety, fearless concurrency, and productivity boosters...
New
New

Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
New

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

Author Spotlight
James Stanier
@jstanier
James Stanier, author of Effective Remote Work , discusses how to rethink the office as we e...
New

Build efficient applications that exploit the unique benefits of a pure functional language, learning from an engineer who uses Haskell t...
New

Author Spotlight
Dmitry Zinoviev
@aqsaqal
Today we’re putting our spotlight on Dmitry Zinoviev, author of Data Science Essentials in ...
New

The overengineered Solution to my Pigeon Problem.
TL;DR: I built a wifi-equipped water gun to shoot the pigeons on my balcony, controlle...
New

Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
New
Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /rails
- /js
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /java
- /haskell
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /ash
- /vscode
- /opensuse
- /centos
- /php
- /deepseek
- /html
- /zig
- /scala
- /debian
- /nixos
- /lisp
- /textmate
- /sublime-text
- /agda
- /react-native
- /kubuntu
- /arch-linux
- /ubuntu
- /revery
- /spring
- /django
- /manjaro
- /diversity
- /nodejs
- /lua
- /julia
- /c
- /slackware
- /neovim