Skip to content

Instantly share code, notes, and snippets.

@naoyamakino
Forked from kmdupr33/MainActivity.java
Last active August 29, 2015 14:25
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 naoyamakino/1dd11086b57486b95b17 to your computer and use it in GitHub Desktop.
Save naoyamakino/1dd11086b57486b95b17 to your computer and use it in GitHub Desktop.
Showing the terrible practice of having a static reference to a context
public class MainActivity extends LocationManagingActivity implements ActionBar.OnNavigationListener,
GooglePlayServicesClient.ConnectionCallbacks,
GooglePlayServicesClient.OnConnectionFailedListener {
//...
private static MeTrackerStore mMeTrackerStore;
//...
@Override
protected void onCreate(Bundle savedInstanceState) {
//...
mMeTrackerStore = new MeTrackerStore(this);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment