Questions tagged as 'android-context'

3
answers

Differences in how to get the context in Android

What are the essential differences between the methods getContext() , getApplicationContext() , getBaseContext() , and this to get the context in Android ? I know it can be a very trivial or very broad question,...
asked by 05.12.2016 / 13:24
4
answers

Failed to getWritableDatabase (); Android

It gives me a mistake when it comes to establishing the database as writable in this line: SQLiteDatabase db = baseDatos.getWritableDatabase(); Android Monitor ERROR: FATAL EXCEPTION: main...
asked by 19.05.2017 / 13:33
2
answers

Error in getApplicationContext () Android

I am trying to load a Toast Messagge. Inside a class that "paints" a ViewPager . The problem is that I am having an error when it comes to picking up the context. What could I be doing wrong? public class ScreenSlidePageFragment e...
asked by 24.05.2017 / 14:34
1
answer

Problem with the context of a Toast

The program marks me error in the context of toast . I already tried with getApplicationContext() , with NombreActivity.this and with only this . I have a main activity called ReaderActivity, from it I send a call to...
asked by 12.06.2018 / 23:03
1
answer

Display a DialogFragment from an Adapter RecyclerView

I have a problem trying to show a Dialogfragment from an Adapter. Normally I have done this by calling parent.Context of inflater , as follows: public class MiAdapter extends RecyclerView.Adapter<MiAdapter.adapterHolder>{...
asked by 07.04.2018 / 01:45
1
answer

Problem with fragments

I'm doing a ViewPager that contains 3 fragments. Each fragment, when starting, has to make an asynchronous call to retrieve certain data through a query to a database. These calls are good, the problem is that, once in this activity, if I...
asked by 21.12.2017 / 10:07
1
answer

How to refer from a ready adapter to the context that inflates it

   Good I have a problem and it is that when inflating a list I am created an event on click of an item, this works without problems: it opens me without problems the following window, but here comes the problem, using the same context no...
asked by 04.06.2018 / 19:05
0
answers

How to maintain the context of the main activity in all the elements of the ViewPager?

I had my application in a single layout, in order to improve it I am trying to implement a main layout with a ViewPager and through it access the different layout in which I divided the app. When I had everything in one layout, it did not presen...
asked by 11.07.2018 / 19:54
1
answer

Problem in onClickListener with Button in Fragment to show data in Activity that contains the Fragment

I'm a rookie newbie on Android and I'm doing a project which contains: ActiviyMain.class ActivityMain.Layout Fragment.Class Fragment.layout It turns out that I have a button in the Fragment.layout that is inside the ActivityMain layout,...
asked by 22.05.2017 / 07:32