Top "Android-context" questions

Interface to global information about an application environment

Get application context from non activity singleton class

In my android project, I have ImageAdapter class in which I pass app context for some further needs. public class …

java android singleton baseadapter android-context
Best way to get an Application Context into a static method in Android

I'm working on an Android application that has several Activities. In it I have a class with several static methods. …

android android-context
How to get activity context into a non-activity class android?

I have a Activity class from where I am passing some information to a helper class(Non-activity) class. In the …

java android android-context
Retrieve Context from a fragment

I created a class to retrieve comments from a JSON encoding from a PHP file. This class, extends from AsyncTask: …

java android android-fragments android-asynctask android-context
Difference in context this and getContext()

What is difference between this and getContext(), when I say this I mean this within an Activity.

android this android-context
getApplicationContext() on a null object reference

I allways get this java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.content.Context.getApplicationContext()' …

android nullpointerexception android-volley android-context
Android - Getting context from a Broadcast receiver onReceive() to send to

I basically want to make an intent and pass it to a service from my BroadcastReceiver's onReceive(). So far I …

android android-intent service broadcastreceiver android-context
Dagger 2 injecting Android Application Context

I am using Dagger 2 and have it working however I now need access to the Android Application Context. Its not …

android dependency-injection android-context dagger-2
What is the difference between Activity and Context?

Are Activity and Context the same, or are there differences? When should I have a method pass an Activity, and …

android android-activity android-context
How to mock Context using Mockito?

I'm using Context to access system level services like WifiManager and BluetoothManager. How to mock this getApplicationContext() using Mockito?

android bluetooth mockito android-wifi android-context