"how to retrieve the position in a listview with firebase results" Code Answer

1

to solve this, you need to change the following line of code:

mrootdatabase = getadapter(mcontext).getitem(position);

to

mrootdatabase = adapter.getref(position);

in which adapter variable is the actual adapter that you are using to display the data.

edit:

you cannot use getref() method, unless you are using firebase-ui library. you cannot get the databasereference object from the arrayadapter object. none of the methods inside this class return a databasereference object. the only way in which you can achieve this is to use firebase-ui library.

By stackerjoe on May 15 2022

Answers related to “how to retrieve the position in a listview with firebase results”

Only authorized users can answer the Search term. Please sign in first, or register a free account.