Giter VIP home page Giter VIP logo

Comments (6)

mykhailoperemitko avatar mykhailoperemitko commented on June 24, 2024 7

Hey all!

I patched ClipboardModule.java to make it compatible with the latest changes in RN. Seems to work fine for now.

diff --git a/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java b/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java
index 4ecb0cb..b664b3c 100644
--- a/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java
+++ b/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java
@@ -11,7 +11,9 @@ import android.content.ClipboardManager;
 import android.content.ClipData;
 import android.content.Context;
 
-import com.facebook.react.bridge.ContextBaseJavaModule;
+import com.facebook.react.bridge.ReactApplicationContext;
+import com.facebook.react.bridge.ReactContext;
+import com.facebook.react.bridge.ReactContextBaseJavaModule;
 import com.facebook.react.bridge.ReactMethod;
 import com.facebook.react.bridge.Promise;
 import com.facebook.react.module.annotations.ReactModule;
@@ -20,10 +22,13 @@ import com.facebook.react.module.annotations.ReactModule;
  * A module that allows JS to get/set clipboard contents.
  */
 @ReactModule(name = ClipboardModule.NAME)
-public class ClipboardModule extends ContextBaseJavaModule {
+public class ClipboardModule extends ReactContextBaseJavaModule {
+  private Context context;
 
-  public ClipboardModule(Context context) {
+  public ClipboardModule(ReactApplicationContext context) {
     super(context);
+
+    this.context = context;
   }
 
   public static final String NAME = "RNCClipboard";
@@ -34,7 +39,7 @@ public class ClipboardModule extends ContextBaseJavaModule {
   }
 
   private ClipboardManager getClipboardService() {
-    return (ClipboardManager) getContext().getSystemService(getContext().CLIPBOARD_SERVICE);
+    return (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
   }
 
   @ReactMethod

from clipboard.

chinNuttawot avatar chinNuttawot commented on June 24, 2024

 me too

from clipboard.

edritech93 avatar edritech93 commented on June 24, 2024

same for me

from clipboard.

Parathantl avatar Parathantl commented on June 24, 2024

same for me

from clipboard.

nguyenductoan1995 avatar nguyenductoan1995 commented on June 24, 2024

Is there a way to solve this problem yet, everyone?

from clipboard.

andriiradkevych avatar andriiradkevych commented on June 24, 2024

@Naturalclar isn't it the same #238

@mykhailoperemitko can you check ?

from clipboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.