Intent之间无法传递大数据的替代方法

/**
 * TODO: Activity之间传递list,对象等工具类
 * 
 * @author 
 * @date 2014-9-12 下午5:35:38
 * @version 0.1.0 
 */
public class FlashIntentUtils {
    private static volatile FlashIntentUtils instance = null;

    private FlashIntentUtils(){
    }

    public static FlashIntentUtils getInstance() {
        if (instance == null) {
            synchronized (FlashIntentUtils.class) {
                if (instance == null) {
                    instance = new FlashIntentUtils();
                }
            }
        }

        return instance;
    }
    private Object object;
    public void putExtra(Object object) {
        this.object = object;
    }
    public Object getExtra() {
        Object extra = object;
        this.object = null;
        return extra;
    }
}

当然也有其他方式,比如写入文件或者sqlite里面。

 

posted @ 2014-12-22 13:45  西北野狼  阅读(689)  评论(0编辑  收藏  举报