android-context
Accessing Resources without a Context
Use Resources.getSystem().getString(android.R.string.someuniversalstuff) You can use it ABSOLUTELY EVERYWHERE in your application, even in static constants declaration! But for system resources only. For local resources use that solution.
Why does AlertDialog.Builder(Context context) only accepts Activity as a parameter?
An Activity inherits a Context. AlertDialog.Builder specifies a Context argument because it can then be used by ANY class that is a subclass of Context, including an Activity, ListActivity, Service, … (There is a common coding idiom behind this – you can learn more about it by reading Item I8 (on Interfaces and Abstract classes) … Read more