小编Abd*_*wan的帖子

尝试在firebase上填充listview时没有setter/field

我正在尝试从firebase检索数据并使用firebase-ui将其显示在listview上.代码运行正常,但列表视图中没有显示任何内容.这是我从日志中得到的:

W/ClassMapper:在类com.example.sammie.coreteccontacts.Sacco上找不到-KNRXdDOlA9nV6qxXvOl的setter/field

这是我的FirebaselistAdapter

DatabaseReference mDatabaseReference = FirebaseDatabase.getInstance().getReference();
FirebaseListAdapter<Sacco> adapter = new FirebaseListAdapter<Sacco>(getActivity(), Sacco.class, android.R.layout.simple_list_item_1, mDatabaseReference) {
 @Override
protected void populateView(View view, Sacco sacco, int i) {
((TextView)view.findViewById(android.R.id.text1)).setText(Sacco.getName());
}
};
contactList.setAdapter(adapter);
Run Code Online (Sandbox Code Playgroud)

这是我的Sacco课程:

package com.example.sammie.coreteccontacts;

public class Sacco {

    String description;
    String location;
    static String name;

    public Sacco() {
    }

    public Sacco(String description, String location, String name) {
        this.name = name;
        this.description = description;
        this.location = location;
    }

    public static String getName() {
        return name;
    }

    public String getDescription() {
        return description; …
Run Code Online (Sandbox Code Playgroud)

android listview firebase firebase-realtime-database firebaseui

5
推荐指数
1
解决办法
6049
查看次数

Android:如何将HTML代码转换为图像并使用ShareIntent发送此图像?

我已使用webView将内容显示和捕获为图像,并使用共享选项发送。
但是我需要一个无需使用webview即可将html代码转换为图像的功能。
请帮我。
提前致谢。

android android-intent android-bitmap

2
推荐指数
1
解决办法
3286
查看次数