-
-
Save CarlosACepeda/16db6dc38b2da382b20ff92c045d8ea3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
package pl.pszklarska.leakexample; | |
import android.content.Context; | |
import android.widget.Toast; | |
public class StaticContextLeak { | |
private static Context context; | |
public void setContext(final Context context) { | |
this.context = context; | |
} | |
private static void showToast(String text) { | |
Toast.makeText(context, text, Toast.LENGTH_SHORT).show(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment