Created
January 11, 2020 13:28
-
-
Save shikto1/47311b1002064682bb7aac6ef45baf9b 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
| public class StaticReferenceLeakActivity extends AppCompatActivity { | |
| /* | |
| * This is a bad idea! | |
| */ | |
| private static TextView textView; | |
| private static Activity activity; | |
| @Override | |
| protected void onCreate(@Nullable Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.activity_first); | |
| textView = findViewById(R.id.activity_text); | |
| textView.setText("Bad Idea!"); | |
| activity = this; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment