I have a Firebase DB which I\'m using the push()
method to add entries to DB, thus generating the random key as a reference for each entry.
In part of t
You say you have a FirebaseListAdapter
. If that is the case, you can get a reference to a specific item at a position with adapter.getRef()
.
myListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
DatabaseReference itemRef = adapter.getRef(position);
Toast toast = Toast.makeText(getActivity().getApplicationContext(), itemRef.getKey(), Toast.LENGTH_SHORT);
toast.show();
}
});