firebaselist适配器无法查看文本

时间:2016-05-18 20:30:21

标签: android firebase firebase-realtime-database firebaseui

每件事情都运作良好,但文字虽然列表添加项目,但是当我添加到新的孩子时,我已尝试更改R.layout.simple_list_item_1,但它不起作用 p>

Firebase ref = new Firebase("https://shoppinglist-fahmi.firebaseio.com/msg");
    FirebaseListAdapter<String> listAdapter = new FirebaseListAdapter<String>(this,String.class, android.R.layout.simple_list_item_1,ref) {
        @Override
        protected void populateView(View view, String s, int i) {
}
    };
    listView.setAdapter(listAdapter);

1 个答案:

答案 0 :(得分:2)

您需要实施populateView()以将s的值传递到view

protected void populateView(View view, String s, int i) {
  ((TextView) view.findViewById(android.R.id.text1)).setText(s);
}
相关问题