Permalink
Browse files

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 #11796

Differential Revision: D4437893

Pulled By: hramos

fbshipit-source-id: fbb026e4480ae08128404ed2cf4ddb00a35f7d7b
  • Loading branch information...
AgtLucas authored and facebook-github-bot committed Jan 19, 2017
1 parent 8290194 commit dd8231ad63f9c8a12a602ffb2f34411ba585851c
Showing with 4 additions and 5 deletions.
  1. +4 −5 docs/Debugging.md
View
@@ -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)

0 comments on commit dd8231a

Please sign in to comment.