From dd8231ad63f9c8a12a602ffb2f34411ba585851c Mon Sep 17 00:00:00 2001 From: AgtLucas Date: Thu, 19 Jan 2017 14:06:54 -0800 Subject: [PATCH] Fix Android debugging doc Summary: I've tried to debug my Android app using Stetho as is documented [here](https://facebook.github.io/react-native/docs/debugging.html#debugging-with-stetho-http-facebook-github-io-stetho-on-android), but, it turns out the documentation is wrong, because if we pass `Bundle savedInstanceState` to `onCreate` method, the app crashes itself, so I've updated the documentation accordingly. Closes https://github.com/facebook/react-native/pull/11796 Differential Revision: D4437893 Pulled By: hramos fbshipit-source-id: fbb026e4480ae08128404ed2cf4ddb00a35f7d7b --- docs/Debugging.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/Debugging.md b/docs/Debugging.md index 8817229cd..410d153fb 100644 --- a/docs/Debugging.md +++ b/docs/Debugging.md @@ -94,7 +94,7 @@ The debugger will receive a list of all project roots, separated by a space. For > Custom debugger commands executed this way should be short-lived processes, and they shouldn't produce more than 200 kilobytes of output. -### Debugging with [Stetho](http://facebook.github.io/stetho/) on Android +### Debugging with [Stetho](http://facebook.github.io/stetho/) on Android 1. In ```android/app/build.gradle```, add these lines in the `dependencies` section: @@ -103,10 +103,9 @@ The debugger will receive a list of all project roots, separated by a space. For compile 'com.facebook.stetho:stetho-okhttp3:1.3.1' ``` -2. In ```android/app/src/main/java/com/{yourAppName}/MainApplication.java```, add the following imports: +2. In ```android/app/src/main/java/com/{yourAppName}/MainApplication.java```, add the following imports: ```java - import android.os.Bundle; import com.facebook.react.modules.network.ReactCookieJarContainer; import com.facebook.stetho.Stetho; import okhttp3.OkHttpClient; @@ -117,8 +116,8 @@ The debugger will receive a list of all project roots, separated by a space. For 3. In ```android/app/src/main/java/com/{yourAppName}/MainApplication.java``` add the function: ```java - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); + public void onCreate() { + super.onCreate(); Stetho.initializeWithDefaults(this); OkHttpClient client = new OkHttpClient.Builder() .connectTimeout(0, TimeUnit.MILLISECONDS)