J
J
JordanBelford2017-06-01 17:32:18
Android
JordanBelford, 2017-06-01 17:32:18

When getting a link to the base context, idea swears, what should I do?

Everything was fine in the activity, in the fragment it swears, what could be the problem?

private void updateUI() {
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(getBaseContext(), android.R.layout.simple_list_item_1, drive);
        ListUserDrive.setAdapter(adapter);

    }

ef08ba49c205437aa748672871a58d69.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Zagaevsky, 2017-06-01
@JordanBelford

And rightly so, fragments do not have this method. Use getActivity or getContext.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question