Browse Source

Enable debugging

Jamie Birch 5 years ago
parent
commit
dd3a09bd70

+ 7
- 0
example/android/app/src/main/java/com/example/MainApplication.java View File

2
 
2
 
3
 import android.app.Application;
3
 import android.app.Application;
4
 import android.content.Context;
4
 import android.content.Context;
5
+import android.os.Build;
6
+import android.webkit.WebView;
7
+
5
 import com.facebook.react.PackageList;
8
 import com.facebook.react.PackageList;
6
 import com.facebook.react.ReactApplication;
9
 import com.facebook.react.ReactApplication;
7
 import com.facebook.react.ReactNativeHost;
10
 import com.facebook.react.ReactNativeHost;
44
   @Override
47
   @Override
45
   public void onCreate() {
48
   public void onCreate() {
46
     super.onCreate();
49
     super.onCreate();
50
+    /* https://developers.google.com/web/tools/chrome-devtools/remote-debugging/webviews */
51
+    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
52
+      WebView.setWebContentsDebuggingEnabled(true);
53
+    }
47
     SoLoader.init(this, /* native exopackage */ false);
54
     SoLoader.init(this, /* native exopackage */ false);
48
     initializeFlipper(this); // Remove this line if you don't want Flipper enabled
55
     initializeFlipper(this); // Remove this line if you don't want Flipper enabled
49
   }
56
   }