I am trying to create a Firebase database to store employee information and then when an address is queried, all the employees staying in that particular area should be displayed in a ListView or a RecyclerView however, I am having the following problem:
I am unable to populate the ListView.
ArrayList<String> mItems = new ArrayList<>();
ArrayAdapter mAdapter;
ListView mRecyclerView;
FirebaseListAdapter<String> fireAdapter = new FirebaseListAdapter<String>() {
@Override
protected void populateView(View view, String s) {
//populate view
}
};
In the above code, I am unable to write the constructor so that it becomes,
FirebaseListAdapter<String> fireAdapter = new FirebaseListAdapter<String>(this,String.class,
android.R.layout.simple_list_item_1,mEmployRef) {
@Override
protected void populateView(View view, String s) {
//populate view
}
};
When I write the above code with the constructor, it says,
Cannot resolve constructor 'FirebaseListAdapter(anonymous android.view.View.OnClickListener, java.lang.Class, int, com.google.firebase.database.DatabaseReference)'
How do I resolve this? A similar problem occurs when I try to use a RecyclerView.