Most voted "android-context" questions
None
Learn more…9 questions
Sort by count of
-
24
votes2
answers17995
viewsWhat is a context on Android?
What is a context on Android? What’s the difference between getContext(), getApplicationContext(), getBaseContext()? Has some relationship with getActivity?…
-
8
votes3
answers813
viewsWhat is the difference between methods for obtaining a context?
One can, beyond the this, get the context in several ways, with different methods. As shown in the code below, we have the getApplicationContext() and the getBaseContext() which apparently serves…
-
2
votes2
answers949
viewsWhat is the best way to pass a context to a nested class?
I have a nested class that’s used for a new Thread and it has some Toast to present some information to the user depending on the error. I tried to pass the context through the constructor, I…
-
2
votes1
answer3044
viewsHow to get the context in a Fragment?
What should I insert into a method that needs the context argument in this Fragment ? public class Tab1tests extends Fragment { private ViewPager mViewPager; private…
-
1
votes2
answers96
viewsNullpointerexception when deleting register
Good morning. I have a problem I can’t solve. I am developing my first Android app and bumped into this error, Sqlite can not work with Context. I did some research and I couldn’t find a solution. I…
android sqlite nullpointerexception android-context android-recyclerviewasked 8 years, 4 months ago Charles Presidente 91 -
1
votes1
answer58
viewsStatic objects in Activities with View Pagers
I have an Activity with a view pager, and this one controls three fragments, F1, F2, F3. The F1 fragment shows user-added items, the F2 fragment loads all items from an external server, showing them…
android android-fragment static android-context android-recyclerviewasked 8 years, 2 months ago Guilherme Ramos 343 -
1
votes0
answers60
viewsError while using "this"
I’m trying to implement a code with direct dial using Action_call in android studio but this giving error in this and can not solve , someone could help me?…
-
1
votes0
answers90
viewsAndroid: Error in getcontext() when using Sharedpreferences
I’m using SharedPreferences with Retrofit2 and notificações. Each time the Notification is executed I get the exception "'java.lang.String android.content.Context.getPackageName()' on a null object…
-
0
votes1
answer421
viewsContext error in Fragment
have a problem, I found a tutorial to create a Listview but is implemented with extends Activity and I’m with extend Fragment and so I have an error in the place marked with an arrow: package…