我有以下结构:
如何使用FirebaseListAdapter
在Discussion对象中显示这两个问题?以下代码未给出预期结果
FirebaseDatabase database = FirebaseDatabase.getInstance();
DatabaseReference myRef = database.getReference("Discussion");
myAdapter = new FirebaseListAdapter<String>(this,String.class,android.R.layout.simple_list_item_1,myRef) {
@Override
protected void populateView(View view, String s, int i) {
TextView text = (TextView) view.findViewById(android.R.id.text1);
text.setText(s);
}
};
GridView gv = (GridView) findViewById(R.id.gridView);
gv.setAdapter(myAdapter);