codepath / codepath/android_guides
Proper example for using application context is not clear.
Open
- 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.