clipboard
clipboard copied to clipboard
Android cannot get the clipboard content
Environment
react-native 0.63.3
Platforms
Android
Versions
- Android:Android 10
- iOS:
- react-native-netinfo:
- react-native:
- react:
Description
cannot get the clipboard content when app Toggle front and back, only Kill the app, open again and get it
Reproducible Demo
I was find this bug too。hope fix this problem quickly
Limited access to clipboard data Unless your app is the default input method editor (IME) or is the app that currently has focus, your app cannot access clipboard data on Android 10 or higher. (source)
I managed to get it to work by adding a delay after app comes to foreground and before getting clipboard
I can't get clipboard data even if it has the focus. I get an error when I use getString()
method:
[TypeError: undefined is not a function]
Limited access to clipboard data Unless your app is the default input method editor (IME) or is the app that currently has focus, your app cannot access clipboard data on Android 10 or higher. (source)
I managed to get it to work by adding a delay after app comes to foreground and before getting clipboard
Thanks. I gave it setTimeout function.
Getting this, I just installed the package and run in on Android OS, but it fails to run in the Android simulator. import com.facebook.react.bridge.ContextBaseJavaModule; ^ symbol: class ContextBaseJavaModule location: package com.facebook.react.bridge