-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from BaristaVentures/fix/stetho-memory-leak
Fix stetho memory leak
- Loading branch information
Showing
22 changed files
with
341 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
sample/src/main/java/debug_artist/sample/LauncherActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package debug_artist.sample; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.support.annotation.Nullable; | ||
import android.support.v7.widget.Toolbar; | ||
import android.view.View; | ||
import debug_artist.sample.base.BasicActivity; | ||
import debug_artist.sample.stetho.StethoActivity; | ||
|
||
public class LauncherActivity extends BaseActivity { | ||
|
||
@Override | ||
protected void onCreate(@Nullable Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_launcher); | ||
setSupportActionBar((Toolbar) findViewById(R.id.toolbar)); | ||
|
||
findViewById(R.id.basicButton).setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
startActivity(new Intent(LauncherActivity.this, BasicActivity.class)); | ||
} | ||
}); | ||
|
||
findViewById(R.id.stethoButton).setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
startActivity(new Intent(LauncherActivity.this, StethoActivity.class)); | ||
} | ||
}); | ||
} | ||
|
||
} |
20 changes: 0 additions & 20 deletions
20
sample/src/main/java/debug_artist/sample/MainActivity.java
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
sample/src/main/java/debug_artist/sample/base/BasicActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package debug_artist.sample.base; | ||
|
||
import android.os.Bundle; | ||
import android.support.v7.widget.Toolbar; | ||
import debug_artist.sample.BaseActivity; | ||
import debug_artist.sample.R; | ||
|
||
public class BasicActivity extends BaseActivity { | ||
|
||
public static BasicActivity activityLeaked; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_basic); | ||
setSupportActionBar((Toolbar) findViewById(R.id.toolbar)); | ||
getSupportActionBar().setDisplayHomeAsUpEnabled(true); | ||
|
||
// Intentionally to leak memory and see it with leak canary | ||
activityLeaked = this; | ||
|
||
// Check BaseActivity for Debug Artist Initialization | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
sample/src/main/java/debug_artist/sample/stetho/RandomService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package debug_artist.sample.stetho; | ||
|
||
import okhttp3.Request; | ||
import retrofit2.Call; | ||
import retrofit2.http.GET; | ||
import retrofit2.http.Query; | ||
|
||
interface RandomService { | ||
|
||
// Just a get to google.com, we dont need to parse the results, just do a request that works forever :P | ||
@GET("/") | ||
Call<Request> get(@Query("format") String format); | ||
} |
Oops, something went wrong.