Top "Android-context" questions

Interface to global information about an application environment

What's "tools:context" in Android layout files?

Starting with a recent new version of ADT, I've noticed this new attribute on the layout XML files, for example: &…

android xml android-layout android-context android-tools-namespace
Using getResources() in non-activity class

I am trying to use getResources method in a non-activity class. How do I get the reference to the "resources" …

android android-context
getString Outside of a Context or Activity

I've found the R.string pretty awesome for keeping hardcoded strings out of my code, and I'd like to keep …

java android string android-resources android-context
getActivity() returns null in Fragment function

I have a fragment (F1) with a public method like this public void asd() { if (getActivity() == null) { Log.d("yes","…

android android-fragments android-activity null android-context
How do you obtain a Drawable object from a resource id in android package?

I need to get a Drawable object to display on an image button. Is there a way to use the …

android resources drawable android-context
Call to getLayoutInflater() in places not in activity

What does need to be imported or how can I call the Layout inflater in places other than activity? public …

android service android-context toast layout-inflater
get Context in non-Activity class

In an android Application, is there any way to get the context in android in a non-activity class if the …

android android-context
How do I view Android application specific cache?

Is there any way to dynamically view the application specific cache in Android? I'm saving images to the cache (/data/…

android image caching android-context
Difference between Activity Context and Application Context

This has me stumped, I was using this in Android 2.1-r8 SDK: ProgressDialog.show(getApplicationContext(), ....); and also in Toast t = …

android android-context
Android Get Application's 'Home' Data Directory

A simple question, relating to the default 'home' directory when an app writes to the internal memory. By default, any …

android android-context home-directory