codepath / codepath/android_guides

Proper example for using application context is not clear.

Open
#289 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
28.3k
Forks
6.2k
PR merge metrics
No merged PRs in 30d

Description

https://github.com/codepath/android_guides/wiki/Using-Context

* If storing in a private static variable is wrong, why is this fragment still seemingly using it?
* Why even use a singleton then?

``` java
public static CustomManager getInstance(Context context) {
if (sInstance == null) {
sInstance = new CustomManager(context.getApplicationContext());
}

return sInstance;
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.