facebookarchive / stetho

Stetho is a debug bridge for Android applications, enabling the powerful Chrome Developer Tools and much more.
http://facebook.github.io/stetho/
MIT License
12.66k stars 1.13k forks source link

I couldn't receive Network Inspection on my app #679

Open newtestpage opened 4 years ago

newtestpage commented 4 years ago

Hi I am completely newbie in this section . I wanted to get network inspection on my android app , nut I couldn't . How I can do it properly ? This is my activity code:

`public class MainActivity extends AppCompatActivity {

OkHttpClient client;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    client = new OkHttpClient.Builder()
            .addNetworkInterceptor(new StethoInterceptor())
            .build();

    AsyncTask.execute(new Runnable() {
        @Override
        public void run() {
            try {
                String ali = runLoad("https://www.telewebion.com/live/tv3");
                Log.i("taggg",ali);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    });

}

public String runLoad(String url) throws IOException {
    Request request = new Request.Builder()
            .url(url)
            .build();

    try (Response response = client.newCall(request).execute()) {
        return response.body().string();
    }
}

}`

I would appreciate it if someone could help me on this case . I just got normal data (webpage source) and nothing more .

mshenawy22 commented 4 years ago

same here