如何使用Pojo模式存储和检索值

时间:2018-06-26 17:17:35

标签: java android

package ModelClass;

import java.util.ArrayList;

public class ServicesCollection {
    private ArrayList<String>services;
    private ArrayList<String>serviceId;
    private ArrayList<String>duration;

    public ServicesCollection(ArrayList<String> services, ArrayList<String> serviceId, ArrayList<String> duration) {
        this.services = services;
        this.serviceId = serviceId;
        this.duration = duration;
    }

    public ServicesCollection(){

    }


    public ArrayList<String> getServices() {
        return services;
    }

    public void setServices(ArrayList<String> services) {
        this.services = services;
    }

    public ArrayList<String> getServiceId() {
        return serviceId;
    }

    public void setServiceId(ArrayList<String> serviceId) {
        this.serviceId = serviceId;
    }

    public ArrayList<String> getDuration() {
        return duration;
    }

    public void setDuration(ArrayList<String> duration) {
        this.duration = duration;
    }


}

我想将firestore的详细信息存储在ModelClass中,并且我想在不同的活动中从该ModelClass检索值。我试图设置值。但是,当我尝试在不同的活动中获取值时,它将返回null。

0 个答案:

没有答案