Json数据解析模拟美团界面显示

2019-12-10 19:30:02丽君

xml文件:

<LinearLayout xmlns:android="http://www.easck.com/apk/res/android"
xmlns:tools="http://www.easck.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.lixu.testjsonall.MainActivity" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/title_log"
android:orientation="horizontal" >
<ImageView
android:id="@+id/fanhui"
android:layout_width="dp"
android:layout_height="dp"
android:layout_gravity="center"
android:src="@drawable/btn_back" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text=" 我的关注"
android:textSize="sp" />
</LinearLayout>
<ListView
android:id="@+id/lv"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>

解析网络json数据,模拟美团界面显示相关内容就给大家介绍到这里,希望对大家有所帮助。

接着给大家介绍模拟json数据解析格式

// String response =
// "{"code":"1","desc":"success","data":{"showCount":"10","totalCount":"1","totalPage":"1","currPage":"1","offset":"0"},"apps":["
// +
// "{"id":1,"status":"1","url":"www.qq.com","rank":"1","title":"QQ","createtime":"1325088000000","updatetime":"1325088000000","remarks":"??","intro":"酷我音乐2012是酷我音乐专为android平台量身定做的专业在线音乐播放","isusable":"1","isjoint":"1","micon":"http://www.easck.com/upload/widget/splidapps/m/2011-10/vapk_1.jpg","appcount":"20","storename":"anzhuo"},"
// +
// "{"id":2,"status":"1","url":"www.wabang.com","rank":"1","title":"web","createtime":"1325606400000","updatetime":"1325606400000","remarks":"??","intro":"正点闹钟,基本上其他闹钟满足不了的功能都涵盖了","isusable":"1","isjoint":"1","micon":"http://www.easck.com/upload/widget/splidapps/m/2011-10/vapk_1.jpg","appcount":"20","storename":"anzhuo"}]}";
// }