摘要: 在应用中,可能会在当跳转到另外一个Activity的时候需要传递数据过去,这时就可能用Bundle对象;在MainActivity中,有一个导航至BActivity的Intent, Intent intent = new Intent(Context context, Class class); //new一个Bundle对象,并将要传递的数据导入,Bunde相当于Map结构 Bundle bundle = new Bundle(); bundle.putString("name","Livingstone"); bundle.putXXX(XXXKey 阅读全文
posted @ 2013-04-14 22:14 Livingstone 阅读(1823) 评论(0) 推荐(0) 编辑
摘要: 一、JSON对象解析JSON是一种轻量级的对象,数据体积小,方便传输,易于解析!首先新建一个类工具类JsonUtil,用于获取请求返回的数据public class JsonUtil { private static final String TAG = "JSONUTIL"; public static JSONObject getJSON(String url) throws Exception { return new JSONObject(getRequest(url)); } protected static String getRequest(... 阅读全文
posted @ 2013-04-14 21:40 Livingstone 阅读(489) 评论(1) 推荐(0) 编辑