Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CarlosACepeda/16db6dc38b2da382b20ff92c045d8ea3 to your computer and use it in GitHub Desktop.
Save CarlosACepeda/16db6dc38b2da382b20ff92c045d8ea3 to your computer and use it in GitHub Desktop.
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