Android网络框架-Volley实践 使用Volley打造自定义ListView

这篇文章翻译自Ravi Tamada博客中的Android Custom ListView with Image and Text using Volley

最终效果

这个ListView呈现了一些影视信息,每一行是一个影片的信息,每一行中有一张电影的图片,电影的名字、评分、类型、年份等信息。

1.json数据

我们通过解析json然后拿到数据,这个json数据包括json数组,每个json数组中是一个json对象,json对象中包括了电影的图片url地址、标题、年份、评分、类型等信息

JSON Url:http://api.androidhive.info/json/movies.json

<a target=_blank id="L1" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L1" rel="#L1" style="color: rgb(102, 102, 102); text-decoration: none;">  1</a>
<a target=_blank id="L2" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L2" rel="#L2" style="color: rgb(102, 102, 102); text-decoration: none;">  2</a>
<a target=_blank id="L3" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L3" rel="#L3" style="color: rgb(102, 102, 102); text-decoration: none;">  3</a>
<a target=_blank id="L4" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L4" rel="#L4" style="color: rgb(102, 102, 102); text-decoration: none;">  4</a>
<a target=_blank id="L5" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L5" rel="#L5" style="color: rgb(102, 102, 102); text-decoration: none;">  5</a>
<a target=_blank id="L6" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L6" rel="#L6" style="color: rgb(102, 102, 102); text-decoration: none;">  6</a>
<a target=_blank id="L7" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L7" rel="#L7" style="color: rgb(102, 102, 102); text-decoration: none;">  7</a>
<a target=_blank id="L8" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L8" rel="#L8" style="color: rgb(102, 102, 102); text-decoration: none;">  8</a>
<a target=_blank id="L9" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L9" rel="#L9" style="color: rgb(102, 102, 102); text-decoration: none;">  9</a>
<a target=_blank id="L10" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L10" rel="#L10" style="color: rgb(102, 102, 102); text-decoration: none;"> 10</a>
<a target=_blank id="L11" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L11" rel="#L11" style="color: rgb(102, 102, 102); text-decoration: none;"> 11</a>
          
          
[
{
"title": "Dawn of the Planet of the Apes",
"image": "http://api.androidhive.info/json/movies/1.jpg",
"rating": 8.3,
"releaseYear": 2014,
"genre": ["Action", "Drama", "Sci-Fi"]
},
....
....
]
 来自CODE的代码片
json

2.下载Volley库(volley.jar)

如果你第一次使用Volley框架,我建议你去我之前的文章看一下Android网络框架-Volley(一) 工作原理分析 。然后到百度上下载一个volley.jar。添加到项目的lib文件夹里面

3.布局分析

我选择了RelativeLayout来实现这个布局,图片我们使用volley提供的NetworkImageView

现在我们来新建一个Android项目

4.创建一个新的项目

1.打开eclipse,点击File-->New-->Android Application Project。填好基本信息后,我们把包名命名为info.androidhive.customlistviewvolley

2.将volley.jar添加到项目的lib文件夹下

3.我们先把包建好,我们一共分为4个包: adapterappmodel 和 util  。现在我们项目结构如下:

info.androidhive.customlistviewvolley.adater
info.androidhive.customlistviewvolley.app
info.androidhive.customlistviewvolley.model
info.androidhive.customlistviewvolley.util

4.打开res/values/colors.xml。如果没有colors.xml,我们就自己创建一个。然后添加如下代码

<a target=_blank id="L1" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L1" rel="#L1" style="color: rgb(102, 102, 102); text-decoration: none;">  1</a>
<a target=_blank id="L2" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L2" rel="#L2" style="color: rgb(102, 102, 102); text-decoration: none;">  2</a>
<a target=_blank id="L3" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L3" rel="#L3" style="color: rgb(102, 102, 102); text-decoration: none;">  3</a>
<a target=_blank id="L4" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L4" rel="#L4" style="color: rgb(102, 102, 102); text-decoration: none;">  4</a>
<a target=_blank id="L5" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L5" rel="#L5" style="color: rgb(102, 102, 102); text-decoration: none;">  5</a>
<a target=_blank id="L6" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L6" rel="#L6" style="color: rgb(102, 102, 102); text-decoration: none;">  6</a>
<a target=_blank id="L7" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L7" rel="#L7" style="color: rgb(102, 102, 102); text-decoration: none;">  7</a>
<a target=_blank id="L8" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L8" rel="#L8" style="color: rgb(102, 102, 102); text-decoration: none;">  8</a>
<a target=_blank id="L9" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L9" rel="#L9" style="color: rgb(102, 102, 102); text-decoration: none;">  9</a>
<a target=_blank id="L10" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L10" rel="#L10" style="color: rgb(102, 102, 102); text-decoration: none;"> 10</a>
<a target=_blank id="L11" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L11" rel="#L11" style="color: rgb(102, 102, 102); text-decoration: none;"> 11</a>
<a target=_blank id="L12" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L12" rel="#L12" style="color: rgb(102, 102, 102); text-decoration: none;"> 12</a>
           
           
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name= "genre" >#666666 </color>
<color name= "year" >#888888 </color>
<color name= "list_divider" >#d9d9d9 </color>
<color name= "list_row_start_color" >#ffffff </color>
<color name= "list_row_end_color" >#ffffff </color>
<color name= "list_row_hover_start_color" >#ebeef0 </color>
<color name= "list_row_hover_end_color" >#ebeef0 </color>
</resources>
 来自CODE的代码片
colors.xml
5.打开res/values/dimens.xml。添加如下代码

<a target=_blank id="L1" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L1" rel="#L1" style="color: rgb(102, 102, 102); text-decoration: none;"> 1</a>
<a target=_blank id="L2" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L2" rel="#L2" style="color: rgb(102, 102, 102); text-decoration: none;"> 2</a>
<a target=_blank id="L3" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L3" rel="#L3" style="color: rgb(102, 102, 102); text-decoration: none;"> 3</a>
<a target=_blank id="L4" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L4" rel="#L4" style="color: rgb(102, 102, 102); text-decoration: none;"> 4</a>
<a target=_blank id="L5" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L5" rel="#L5" style="color: rgb(102, 102, 102); text-decoration: none;"> 5</a>
<a target=_blank id="L6" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L6" rel="#L6" style="color: rgb(102, 102, 102); text-decoration: none;"> 6</a>
<a target=_blank id="L7" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L7" rel="#L7" style="color: rgb(102, 102, 102); text-decoration: none;"> 7</a>
<a target=_blank id="L8" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L8" rel="#L8" style="color: rgb(102, 102, 102); text-decoration: none;"> 8</a>
            
            
<resources>
<dimen name= "title" >17dp </dimen>
<dimen name= "rating" >15dip </dimen>
<dimen name= "genre" >13dip </dimen>
<dimen name= "year" >12dip </dimen>
</resources>
 来自CODE的代码片
dimens.xml
6.在写jsva代码之前,我们先完成UI部分,在res下新建一个drawable文件夹,在res/drawable中新建3个xml文件: list_row_bg.xml、list_row_bg_hover.xml 、 list_row_selector.xml 。

list_row_bg.xml -没有被点击时listview的样式
<a target=_blank id="L1" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L1" rel="#L1" style="color: rgb(102, 102, 102); text-decoration: none;"> 1</a>
<a target=_blank id="L2" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L2" rel="#L2" style="color: rgb(102, 102, 102); text-decoration: none;"> 2</a>
<a target=_blank id="L3" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L3" rel="#L3" style="color: rgb(102, 102, 102); text-decoration: none;"> 3</a>
<a target=_blank id="L4" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L4" rel="#L4" style="color: rgb(102, 102, 102); text-decoration: none;"> 4</a>
<a target=_blank id="L5" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L5" rel="#L5" style="color: rgb(102, 102, 102); text-decoration: none;"> 5</a>
<a target=_blank id="L6" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L6" rel="#L6" style="color: rgb(102, 102, 102); text-decoration: none;"> 6</a>
<a target=_blank id="L7" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L7" rel="#L7" style="color: rgb(102, 102, 102); text-decoration: none;"> 7</a>
<a target=_blank id="L8" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L8" rel="#L8" style="color: rgb(102, 102, 102); text-decoration: none;"> 8</a>
             
             
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="@color/list_row_start_color"
android:endColor="@color/list_row_end_color"
android:angle="270" />
</shape>
 来自CODE的代码片
list_row_bg.xml-
list_row_bg_hover.xml -被点击后listview的样式
<a target=_blank id="L1" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L1" rel="#L1" style="color: rgb(102, 102, 102); text-decoration: none;">  1</a>
<a target=_blank id="L2" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L2" rel="#L2" style="color: rgb(102, 102, 102); text-decoration: none;">  2</a>
<a target=_blank id="L3" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L3" rel="#L3" style="color: rgb(102, 102, 102); text-decoration: none;">  3</a>
<a target=_blank id="L4" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L4" rel="#L4" style="color: rgb(102, 102, 102); text-decoration: none;">  4</a>
<a target=_blank id="L5" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L5" rel="#L5" style="color: rgb(102, 102, 102); text-decoration: none;">  5</a>
<a target=_blank id="L6" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L6" rel="#L6" style="color: rgb(102, 102, 102); text-decoration: none;">  6</a>
<a target=_blank id="L7" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L7" rel="#L7" style="color: rgb(102, 102, 102); text-decoration: none;">  7</a>
<a target=_blank id="L8" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L8" rel="#L8" style="color: rgb(102, 102, 102); text-decoration: none;">  8</a>
<a target=_blank id="L9" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L9" rel="#L9" style="color: rgb(102, 102, 102); text-decoration: none;">  9</a>
<a target=_blank id="L10" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L10" rel="#L10" style="color: rgb(102, 102, 102); text-decoration: none;"> 10</a>
              
              
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android= "http://schemas.android.com/apk/res/android"
android:shape= "rectangle" >
<gradient
android:angle= "270"
android:endColor= "@color/list_row_hover_end_color"
android:startColor= "@color/list_row_hover_start_color" />
</shape>
 来自CODE的代码片
list_row_bg_hover.xml
list_row_selector.xml -切换两种样式的slector文件
<a target=_blank id="L1" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L1" rel="#L1" style="color: rgb(102, 102, 102); text-decoration: none;"> 1</a>
<a target=_blank id="L2" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L2" rel="#L2" style="color: rgb(102, 102, 102); text-decoration: none;"> 2</a>
<a target=_blank id="L3" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L3" rel="#L3" style="color: rgb(102, 102, 102); text-decoration: none;"> 3</a>
<a target=_blank id="L4" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L4" rel="#L4" style="color: rgb(102, 102, 102); text-decoration: none;"> 4</a>
<a target=_blank id="L5" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L5" rel="#L5" style="color: rgb(102, 102, 102); text-decoration: none;"> 5</a>
<a target=_blank id="L6" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L6" rel="#L6" style="color: rgb(102, 102, 102); text-decoration: none;"> 6</a>
<a target=_blank id="L7" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L7" rel="#L7" style="color: rgb(102, 102, 102); text-decoration: none;"> 7</a>
<a target=_blank id="L8" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L8" rel="#L8" style="color: rgb(102, 102, 102); text-decoration: none;"> 8</a>
               
               
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android= "http://schemas.android.com/apk/res/android" >
<item android:drawable= "@drawable/list_row_bg" android:state_pressed= "false" android:state_selected= "false" />
<item android:drawable= "@drawable/list_row_bg_hover" android:state_pressed= "true" />
<item android:drawable= "@drawable/list_row_bg_hover" android:state_pressed= "false" android:state_selected= "true" />
</selector>
 来自CODE的代码片
list_row_selector.xml
7.打开 activity_main.xml 添加listview

<a target=_blank id="L1" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L1" rel="#L1" style="color: rgb(102, 102, 102); text-decoration: none;">  1</a>
<a target=_blank id="L2" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L2" rel="#L2" style="color: rgb(102, 102, 102); text-decoration: none;">  2</a>
<a target=_blank id="L3" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L3" rel="#L3" style="color: rgb(102, 102, 102); text-decoration: none;">  3</a>
<a target=_blank id="L4" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L4" rel="#L4" style="color: rgb(102, 102, 102); text-decoration: none;">  4</a>
<a target=_blank id="L5" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L5" rel="#L5" style="color: rgb(102, 102, 102); text-decoration: none;">  5</a>
<a target=_blank id="L6" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L6" rel="#L6" style="color: rgb(102, 102, 102); text-decoration: none;">  6</a>
<a target=_blank id="L7" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L7" rel="#L7" style="color: rgb(102, 102, 102); text-decoration: none;">  7</a>
<a target=_blank id="L8" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L8" rel="#L8" style="color: rgb(102, 102, 102); text-decoration: none;">  8</a>
<a target=_blank id="L9" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L9" rel="#L9" style="color: rgb(102, 102, 102); text-decoration: none;">  9</a>
<a target=_blank id="L10" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L10" rel="#L10" style="color: rgb(102, 102, 102); text-decoration: none;"> 10</a>
<a target=_blank id="L11" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L11" rel="#L11" style="color: rgb(102, 102, 102); text-decoration: none;"> 11</a>
<a target=_blank id="L12" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L12" rel="#L12" style="color: rgb(102, 102, 102); text-decoration: none;"> 12</a>
<a target=_blank id="L13" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L13" rel="#L13" style="color: rgb(102, 102, 102); text-decoration: none;"> 13</a>
<a target=_blank id="L14" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L14" rel="#L14" style="color: rgb(102, 102, 102); text-decoration: none;"> 14</a>
<a target=_blank id="L15" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L15" rel="#L15" style="color: rgb(102, 102, 102); text-decoration: none;"> 15</a>
           
           
<RelativeLayout xmlns:android= "http://schemas.android.com/apk/res/android"
xmlns:tools= "http://schemas.android.com/tools"
android:layout_width= "match_parent"
android:layout_height= "match_parent"
tools:context= ".MainActivity" >
<ListView
android:id= "@+id/list"
android:layout_width= "fill_parent"
android:layout_height= "wrap_content"
android:divider= "@color/list_divider"
android:dividerHeight= "1dp"
android:listSelector= "@drawable/list_row_selector" />
</RelativeLayout>
 来自CODE的代码片
activity_main.xml

8.创建每个item的布局文件 list_row.xml
<a target=_blank id="L1" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L1" rel="#L1" style="color: rgb(102, 102, 102); text-decoration: none;">  1</a>
<a target=_blank id="L2" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L2" rel="#L2" style="color: rgb(102, 102, 102); text-decoration: none;">  2</a>
<a target=_blank id="L3" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L3" rel="#L3" style="color: rgb(102, 102, 102); text-decoration: none;">  3</a>
<a target=_blank id="L4" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L4" rel="#L4" style="color: rgb(102, 102, 102); text-decoration: none;">  4</a>
<a target=_blank id="L5" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L5" rel="#L5" style="color: rgb(102, 102, 102); text-decoration: none;">  5</a>
<a target=_blank id="L6" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L6" rel="#L6" style="color: rgb(102, 102, 102); text-decoration: none;">  6</a>
<a target=_blank id="L7" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L7" rel="#L7" style="color: rgb(102, 102, 102); text-decoration: none;">  7</a>
<a target=_blank id="L8" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L8" rel="#L8" style="color: rgb(102, 102, 102); text-decoration: none;">  8</a>
<a target=_blank id="L9" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L9" rel="#L9" style="color: rgb(102, 102, 102); text-decoration: none;">  9</a>
<a target=_blank id="L10" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L10" rel="#L10" style="color: rgb(102, 102, 102); text-decoration: none;"> 10</a>
<a target=_blank id="L11" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L11" rel="#L11" style="color: rgb(102, 102, 102); text-decoration: none;"> 11</a>
<a target=_blank id="L12" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L12" rel="#L12" style="color: rgb(102, 102, 102); text-decoration: none;"> 12</a>
<a target=_blank id="L13" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L13" rel="#L13" style="color: rgb(102, 102, 102); text-decoration: none;"> 13</a>
<a target=_blank id="L14" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L14" rel="#L14" style="color: rgb(102, 102, 102); text-decoration: none;"> 14</a>
<a target=_blank id="L15" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L15" rel="#L15" style="color: rgb(102, 102, 102); text-decoration: none;"> 15</a>
<a target=_blank id="L16" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L16" rel="#L16" style="color: rgb(102, 102, 102); text-decoration: none;"> 16</a>
<a target=_blank id="L17" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L17" rel="#L17" style="color: rgb(102, 102, 102); text-decoration: none;"> 17</a>
<a target=_blank id="L18" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L18" rel="#L18" style="color: rgb(102, 102, 102); text-decoration: none;"> 18</a>
<a target=_blank id="L19" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L19" rel="#L19" style="color: rgb(102, 102, 102); text-decoration: none;"> 19</a>
<a target=_blank id="L20" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L20" rel="#L20" style="color: rgb(102, 102, 102); text-decoration: none;"> 20</a>
<a target=_blank id="L21" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L21" rel="#L21" style="color: rgb(102, 102, 102); text-decoration: none;"> 21</a>
<a target=_blank id="L22" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L22" rel="#L22" style="color: rgb(102, 102, 102); text-decoration: none;"> 22</a>
<a target=_blank id="L23" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L23" rel="#L23" style="color: rgb(102, 102, 102); text-decoration: none;"> 23</a>
<a target=_blank id="L24" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L24" rel="#L24" style="color: rgb(102, 102, 102); text-decoration: none;"> 24</a>
<a target=_blank id="L25" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L25" rel="#L25" style="color: rgb(102, 102, 102); text-decoration: none;"> 25</a>
<a target=_blank id="L26" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L26" rel="#L26" style="color: rgb(102, 102, 102); text-decoration: none;"> 26</a>
<a target=_blank id="L27" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L27" rel="#L27" style="color: rgb(102, 102, 102); text-decoration: none;"> 27</a>
<a target=_blank id="L28" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L28" rel="#L28" style="color: rgb(102, 102, 102); text-decoration: none;"> 28</a>
<a target=_blank id="L29" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L29" rel="#L29" style="color: rgb(102, 102, 102); text-decoration: none;"> 29</a>
<a target=_blank id="L30" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L30" rel="#L30" style="color: rgb(102, 102, 102); text-decoration: none;"> 30</a>
<a target=_blank id="L31" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L31" rel="#L31" style="color: rgb(102, 102, 102); text-decoration: none;"> 31</a>
<a target=_blank id="L32" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L32" rel="#L32" style="color: rgb(102, 102, 102); text-decoration: none;"> 32</a>
<a target=_blank id="L33" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L33" rel="#L33" style="color: rgb(102, 102, 102); text-decoration: none;"> 33</a>
<a target=_blank id="L34" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L34" rel="#L34" style="color: rgb(102, 102, 102); text-decoration: none;"> 34</a>
<a target=_blank id="L35" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L35" rel="#L35" style="color: rgb(102, 102, 102); text-decoration: none;"> 35</a>
<a target=_blank id="L36" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L36" rel="#L36" style="color: rgb(102, 102, 102); text-decoration: none;"> 36</a>
<a target=_blank id="L37" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L37" rel="#L37" style="color: rgb(102, 102, 102); text-decoration: none;"> 37</a>
<a target=_blank id="L38" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L38" rel="#L38" style="color: rgb(102, 102, 102); text-decoration: none;"> 38</a>
<a target=_blank id="L39" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L39" rel="#L39" style="color: rgb(102, 102, 102); text-decoration: none;"> 39</a>
<a target=_blank id="L40" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L40" rel="#L40" style="color: rgb(102, 102, 102); text-decoration: none;"> 40</a>
<a target=_blank id="L41" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L41" rel="#L41" style="color: rgb(102, 102, 102); text-decoration: none;"> 41</a>
<a target=_blank id="L42" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L42" rel="#L42" style="color: rgb(102, 102, 102); text-decoration: none;"> 42</a>
<a target=_blank id="L43" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L43" rel="#L43" style="color: rgb(102, 102, 102); text-decoration: none;"> 43</a>
<a target=_blank id="L44" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L44" rel="#L44" style="color: rgb(102, 102, 102); text-decoration: none;"> 44</a>
<a target=_blank id="L45" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L45" rel="#L45" style="color: rgb(102, 102, 102); text-decoration: none;"> 45</a>
<a target=_blank id="L46" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L46" rel="#L46" style="color: rgb(102, 102, 102); text-decoration: none;"> 46</a>
<a target=_blank id="L47" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L47" rel="#L47" style="color: rgb(102, 102, 102); text-decoration: none;"> 47</a>
<a target=_blank id="L48" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L48" rel="#L48" style="color: rgb(102, 102, 102); text-decoration: none;"> 48</a>
<a target=_blank id="L49" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L49" rel="#L49" style="color: rgb(102, 102, 102); text-decoration: none;"> 49</a>
<a target=_blank id="L50" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L50" rel="#L50" style="color: rgb(102, 102, 102); text-decoration: none;"> 50</a>
<a target=_blank id="L51" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L51" rel="#L51" style="color: rgb(102, 102, 102); text-decoration: none;"> 51</a>
<a target=_blank id="L52" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L52" rel="#L52" style="color: rgb(102, 102, 102); text-decoration: none;"> 52</a>
<a target=_blank id="L53" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L53" rel="#L53" style="color: rgb(102, 102, 102); text-decoration: none;"> 53</a>
<a target=_blank id="L54" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L54" rel="#L54" style="color: rgb(102, 102, 102); text-decoration: none;"> 54</a>
<a target=_blank id="L55" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L55" rel="#L55" style="color: rgb(102, 102, 102); text-decoration: none;"> 55</a>
<a target=_blank id="L56" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L56" rel="#L56" style="color: rgb(102, 102, 102); text-decoration: none;"> 56</a>
<a target=_blank id="L57" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L57" rel="#L57" style="color: rgb(102, 102, 102); text-decoration: none;"> 57</a>
            
            
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android= "http://schemas.android.com/apk/res/android"
android:layout_width= "fill_parent"
android:layout_height= "wrap_content"
android:background= "@drawable/list_row_selector"
android:padding= "8dp" >
<!-- Volley的NetworkImageView -->
<com.android.volley.toolbox.NetworkImageView
android:id= "@+id/thumbnail"
android:layout_width= "80dp"
android:layout_height= "80dp"
android:layout_alignParentLeft= "true"
android:layout_marginRight= "8dp" />
<!-- 影片标题 -->
<TextView
android:id= "@+id/title"
android:layout_width= "wrap_content"
android:layout_height= "wrap_content"
android:layout_alignTop= "@+id/thumbnail"
android:layout_toRightOf= "@+id/thumbnail"
android:textSize= "@dimen/title"
android:textStyle= "bold" />
<!-- 评分 -->
<TextView
android:id= "@+id/rating"
android:layout_width= "fill_parent"
android:layout_height= "wrap_content"
android:layout_below= "@id/title"
android:layout_marginTop= "1dip"
android:layout_toRightOf= "@+id/thumbnail"
android:textSize= "@dimen/rating" />
<!-- 类别 -->
<TextView
android:id= "@+id/genre"
android:layout_width= "fill_parent"
android:layout_height= "wrap_content"
android:layout_below= "@id/rating"
android:layout_marginTop= "5dp"
android:layout_toRightOf= "@+id/thumbnail"
android:textColor= "@color/genre"
android:textSize= "@dimen/genre" />
<!-- 年份 -->
<TextView
android:id= "@+id/releaseYear"
android:layout_width= "wrap_content"
android:layout_height= "wrap_content"
android:layout_alignParentBottom= "true"
android:layout_alignParentRight= "true"
android:textColor= "@color/year"
android:textSize= "@dimen/year" />
</RelativeLayout>
 来自CODE的代码片
list_row.xml
UI部分我们已经完成了,接下来是java代码部分
9.在util包下新建 LruBitmapCache.java  这个类是用来缓存图片的,这个类我们在之前文章中已经分析过了。参见 Android网络框架-Volley(二) RequestQueue源码分析以及建立一个RequestQueue
<a target=_blank id="L1" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L1" rel="#L1" style="color: rgb(102, 102, 102); text-decoration: none;">  1</a>
<a target=_blank id="L2" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L2" rel="#L2" style="color: rgb(102, 102, 102); text-decoration: none;">  2</a>
<a target=_blank id="L3" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L3" rel="#L3" style="color: rgb(102, 102, 102); text-decoration: none;">  3</a>
<a target=_blank id="L4" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L4" rel="#L4" style="color: rgb(102, 102, 102); text-decoration: none;">  4</a>
<a target=_blank id="L5" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L5" rel="#L5" style="color: rgb(102, 102, 102); text-decoration: none;">  5</a>
<a target=_blank id="L6" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L6" rel="#L6" style="color: rgb(102, 102, 102); text-decoration: none;">  6</a>
<a target=_blank id="L7" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L7" rel="#L7" style="color: rgb(102, 102, 102); text-decoration: none;">  7</a>
<a target=_blank id="L8" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L8" rel="#L8" style="color: rgb(102, 102, 102); text-decoration: none;">  8</a>
<a target=_blank id="L9" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L9" rel="#L9" style="color: rgb(102, 102, 102); text-decoration: none;">  9</a>
<a target=_blank id="L10" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L10" rel="#L10" style="color: rgb(102, 102, 102); text-decoration: none;"> 10</a>
<a target=_blank id="L11" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L11" rel="#L11" style="color: rgb(102, 102, 102); text-decoration: none;"> 11</a>
<a target=_blank id="L12" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L12" rel="#L12" style="color: rgb(102, 102, 102); text-decoration: none;"> 12</a>
<a target=_blank id="L13" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L13" rel="#L13" style="color: rgb(102, 102, 102); text-decoration: none;"> 13</a>
<a target=_blank id="L14" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L14" rel="#L14" style="color: rgb(102, 102, 102); text-decoration: none;"> 14</a>
<a target=_blank id="L15" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L15" rel="#L15" style="color: rgb(102, 102, 102); text-decoration: none;"> 15</a>
<a target=_blank id="L16" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L16" rel="#L16" style="color: rgb(102, 102, 102); text-decoration: none;"> 16</a>
<a target=_blank id="L17" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L17" rel="#L17" style="color: rgb(102, 102, 102); text-decoration: none;"> 17</a>
<a target=_blank id="L18" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L18" rel="#L18" style="color: rgb(102, 102, 102); text-decoration: none;"> 18</a>
<a target=_blank id="L19" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L19" rel="#L19" style="color: rgb(102, 102, 102); text-decoration: none;"> 19</a>
<a target=_blank id="L20" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L20" rel="#L20" style="color: rgb(102, 102, 102); text-decoration: none;"> 20</a>
<a target=_blank id="L21" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L21" rel="#L21" style="color: rgb(102, 102, 102); text-decoration: none;"> 21</a>
<a target=_blank id="L22" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L22" rel="#L22" style="color: rgb(102, 102, 102); text-decoration: none;"> 22</a>
<a target=_blank id="L23" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L23" rel="#L23" style="color: rgb(102, 102, 102); text-decoration: none;"> 23</a>
<a target=_blank id="L24" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L24" rel="#L24" style="color: rgb(102, 102, 102); text-decoration: none;"> 24</a>
<a target=_blank id="L25" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L25" rel="#L25" style="color: rgb(102, 102, 102); text-decoration: none;"> 25</a>
<a target=_blank id="L26" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L26" rel="#L26" style="color: rgb(102, 102, 102); text-decoration: none;"> 26</a>
<a target=_blank id="L27" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L27" rel="#L27" style="color: rgb(102, 102, 102); text-decoration: none;"> 27</a>
<a target=_blank id="L28" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L28" rel="#L28" style="color: rgb(102, 102, 102); text-decoration: none;"> 28</a>
<a target=_blank id="L29" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L29" rel="#L29" style="color: rgb(102, 102, 102); text-decoration: none;"> 29</a>
<a target=_blank id="L30" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L30" rel="#L30" style="color: rgb(102, 102, 102); text-decoration: none;"> 30</a>
<a target=_blank id="L31" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L31" rel="#L31" style="color: rgb(102, 102, 102); text-decoration: none;"> 31</a>
<a target=_blank id="L32" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L32" rel="#L32" style="color: rgb(102, 102, 102); text-decoration: none;"> 32</a>
<a target=_blank id="L33" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L33" rel="#L33" style="color: rgb(102, 102, 102); text-decoration: none;"> 33</a>
<a target=_blank id="L34" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L34" rel="#L34" style="color: rgb(102, 102, 102); text-decoration: none;"> 34</a>
<a target=_blank id="L35" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L35" rel="#L35" style="color: rgb(102, 102, 102); text-decoration: none;"> 35</a>
<a target=_blank id="L36" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L36" rel="#L36" style="color: rgb(102, 102, 102); text-decoration: none;"> 36</a>
<a target=_blank id="L37" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L37" rel="#L37" style="color: rgb(102, 102, 102); text-decoration: none;"> 37</a>
<a target=_blank id="L38" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L38" rel="#L38" style="color: rgb(102, 102, 102); text-decoration: none;"> 38</a>
<a target=_blank id="L39" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L39" rel="#L39" style="color: rgb(102, 102, 102); text-decoration: none;"> 39</a>
             
             
package info . androidhive . customlistviewvolley . util ;
import com.android.volley.toolbox.ImageLoader.ImageCache ;
import android.graphics.Bitmap ;
import android.support.v4.util.LruCache ;
public class LruBitmapCache extends LruCache < String , Bitmap > implements
ImageCache {
public static int getDefaultLruCacheSize () {
final int maxMemory = ( int ) ( Runtime . getRuntime (). maxMemory () / 1024 );
final int cacheSize = maxMemory / 2 ;
return cacheSize ;
}
public LruBitmapCache () {
this ( getDefaultLruCacheSize ());
}
public LruBitmapCache ( int sizeInKiloBytes ) {
super ( sizeInKiloBytes );
}
@Override
protected int sizeOf ( String key , Bitmap value ) {
return value . getRowBytes () * value . getHeight () / 1024 ;
}
@Override
public Bitmap getBitmap ( String url ) {
return get ( url );
}
@Override
public void putBitmap ( String url , Bitmap bitmap ) {
put ( url , bitmap );
}
}
 来自CODE的代码片
LruBitmapCache.java
10.在app包下新建 AppController.java  这个类是用来创建一个单例RequestQueue的,以及初始化一些volley核心对象
<a target=_blank id="L1" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L1" rel="#L1" style="color: rgb(102, 102, 102); text-decoration: none;">  1</a>
<a target=_blank id="L2" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L2" rel="#L2" style="color: rgb(102, 102, 102); text-decoration: none;">  2</a>
<a target=_blank id="L3" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L3" rel="#L3" style="color: rgb(102, 102, 102); text-decoration: none;">  3</a>
<a target=_blank id="L4" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L4" rel="#L4" style="color: rgb(102, 102, 102); text-decoration: none;">  4</a>
<a target=_blank id="L5" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L5" rel="#L5" style="color: rgb(102, 102, 102); text-decoration: none;">  5</a>
<a target=_blank id="L6" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L6" rel="#L6" style="color: rgb(102, 102, 102); text-decoration: none;">  6</a>
<a target=_blank id="L7" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L7" rel="#L7" style="color: rgb(102, 102, 102); text-decoration: none;">  7</a>
<a target=_blank id="L8" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L8" rel="#L8" style="color: rgb(102, 102, 102); text-decoration: none;">  8</a>
<a target=_blank id="L9" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L9" rel="#L9" style="color: rgb(102, 102, 102); text-decoration: none;">  9</a>
<a target=_blank id="L10" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L10" rel="#L10" style="color: rgb(102, 102, 102); text-decoration: none;"> 10</a>
<a target=_blank id="L11" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L11" rel="#L11" style="color: rgb(102, 102, 102); text-decoration: none;"> 11</a>
<a target=_blank id="L12" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L12" rel="#L12" style="color: rgb(102, 102, 102); text-decoration: none;"> 12</a>
<a target=_blank id="L13" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L13" rel="#L13" style="color: rgb(102, 102, 102); text-decoration: none;"> 13</a>
<a target=_blank id="L14" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L14" rel="#L14" style="color: rgb(102, 102, 102); text-decoration: none;"> 14</a>
<a target=_blank id="L15" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L15" rel="#L15" style="color: rgb(102, 102, 102); text-decoration: none;"> 15</a>
<a target=_blank id="L16" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L16" rel="#L16" style="color: rgb(102, 102, 102); text-decoration: none;"> 16</a>
<a target=_blank id="L17" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L17" rel="#L17" style="color: rgb(102, 102, 102); text-decoration: none;"> 17</a>
<a target=_blank id="L18" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L18" rel="#L18" style="color: rgb(102, 102, 102); text-decoration: none;"> 18</a>
<a target=_blank id="L19" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L19" rel="#L19" style="color: rgb(102, 102, 102); text-decoration: none;"> 19</a>
<a target=_blank id="L20" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L20" rel="#L20" style="color: rgb(102, 102, 102); text-decoration: none;"> 20</a>
<a target=_blank id="L21" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L21" rel="#L21" style="color: rgb(102, 102, 102); text-decoration: none;"> 21</a>
<a target=_blank id="L22" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L22" rel="#L22" style="color: rgb(102, 102, 102); text-decoration: none;"> 22</a>
<a target=_blank id="L23" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L23" rel="#L23" style="color: rgb(102, 102, 102); text-decoration: none;"> 23</a>
<a target=_blank id="L24" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L24" rel="#L24" style="color: rgb(102, 102, 102); text-decoration: none;"> 24</a>
<a target=_blank id="L25" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L25" rel="#L25" style="color: rgb(102, 102, 102); text-decoration: none;"> 25</a>
<a target=_blank id="L26" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L26" rel="#L26" style="color: rgb(102, 102, 102); text-decoration: none;"> 26</a>
<a target=_blank id="L27" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L27" rel="#L27" style="color: rgb(102, 102, 102); text-decoration: none;"> 27</a>
<a target=_blank id="L28" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L28" rel="#L28" style="color: rgb(102, 102, 102); text-decoration: none;"> 28</a>
<a target=_blank id="L29" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L29" rel="#L29" style="color: rgb(102, 102, 102); text-decoration: none;"> 29</a>
<a target=_blank id="L30" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L30" rel="#L30" style="color: rgb(102, 102, 102); text-decoration: none;"> 30</a>
<a target=_blank id="L31" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L31" rel="#L31" style="color: rgb(102, 102, 102); text-decoration: none;"> 31</a>
<a target=_blank id="L32" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L32" rel="#L32" style="color: rgb(102, 102, 102); text-decoration: none;"> 32</a>
<a target=_blank id="L33" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L33" rel="#L33" style="color: rgb(102, 102, 102); text-decoration: none;"> 33</a>
<a target=_blank id="L34" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L34" rel="#L34" style="color: rgb(102, 102, 102); text-decoration: none;"> 34</a>
<a target=_blank id="L35" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L35" rel="#L35" style="color: rgb(102, 102, 102); text-decoration: none;"> 35</a>
<a target=_blank id="L36" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L36" rel="#L36" style="color: rgb(102, 102, 102); text-decoration: none;"> 36</a>
<a target=_blank id="L37" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L37" rel="#L37" style="color: rgb(102, 102, 102); text-decoration: none;"> 37</a>
<a target=_blank id="L38" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L38" rel="#L38" style="color: rgb(102, 102, 102); text-decoration: none;"> 38</a>
<a target=_blank id="L39" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L39" rel="#L39" style="color: rgb(102, 102, 102); text-decoration: none;"> 39</a>
<a target=_blank id="L40" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L40" rel="#L40" style="color: rgb(102, 102, 102); text-decoration: none;"> 40</a>
<a target=_blank id="L41" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L41" rel="#L41" style="color: rgb(102, 102, 102); text-decoration: none;"> 41</a>
<a target=_blank id="L42" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L42" rel="#L42" style="color: rgb(102, 102, 102); text-decoration: none;"> 42</a>
<a target=_blank id="L43" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L43" rel="#L43" style="color: rgb(102, 102, 102); text-decoration: none;"> 43</a>
<a target=_blank id="L44" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L44" rel="#L44" style="color: rgb(102, 102, 102); text-decoration: none;"> 44</a>
<a target=_blank id="L45" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L45" rel="#L45" style="color: rgb(102, 102, 102); text-decoration: none;"> 45</a>
<a target=_blank id="L46" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L46" rel="#L46" style="color: rgb(102, 102, 102); text-decoration: none;"> 46</a>
<a target=_blank id="L47" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L47" rel="#L47" style="color: rgb(102, 102, 102); text-decoration: none;"> 47</a>
<a target=_blank id="L48" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L48" rel="#L48" style="color: rgb(102, 102, 102); text-decoration: none;"> 48</a>
<a target=_blank id="L49" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L49" rel="#L49" style="color: rgb(102, 102, 102); text-decoration: none;"> 49</a>
<a target=_blank id="L50" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L50" rel="#L50" style="color: rgb(102, 102, 102); text-decoration: none;"> 50</a>
<a target=_blank id="L51" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L51" rel="#L51" style="color: rgb(102, 102, 102); text-decoration: none;"> 51</a>
<a target=_blank id="L52" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L52" rel="#L52" style="color: rgb(102, 102, 102); text-decoration: none;"> 52</a>
<a target=_blank id="L53" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L53" rel="#L53" style="color: rgb(102, 102, 102); text-decoration: none;"> 53</a>
<a target=_blank id="L54" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L54" rel="#L54" style="color: rgb(102, 102, 102); text-decoration: none;"> 54</a>
<a target=_blank id="L55" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L55" rel="#L55" style="color: rgb(102, 102, 102); text-decoration: none;"> 55</a>
<a target=_blank id="L56" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L56" rel="#L56" style="color: rgb(102, 102, 102); text-decoration: none;"> 56</a>
<a target=_blank id="L57" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L57" rel="#L57" style="color: rgb(102, 102, 102); text-decoration: none;"> 57</a>
<a target=_blank id="L58" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L58" rel="#L58" style="color: rgb(102, 102, 102); text-decoration: none;"> 58</a>
<a target=_blank id="L59" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L59" rel="#L59" style="color: rgb(102, 102, 102); text-decoration: none;"> 59</a>
<a target=_blank id="L60" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L60" rel="#L60" style="color: rgb(102, 102, 102); text-decoration: none;"> 60</a>
<a target=_blank id="L61" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L61" rel="#L61" style="color: rgb(102, 102, 102); text-decoration: none;"> 61</a>
<a target=_blank id="L62" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L62" rel="#L62" style="color: rgb(102, 102, 102); text-decoration: none;"> 62</a>
<a target=_blank id="L63" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L63" rel="#L63" style="color: rgb(102, 102, 102); text-decoration: none;"> 63</a>
<a target=_blank id="L64" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L64" rel="#L64" style="color: rgb(102, 102, 102); text-decoration: none;"> 64</a>
              
              
package info . androidhive . customlistviewvolley . app ;
import info.androidhive.customlistviewvolley.util.LruBitmapCache ;
import android.app.Application ;
import android.text.TextUtils ;
import com.android.volley.Request ;
import com.android.volley.RequestQueue ;
import com.android.volley.toolbox.ImageLoader ;
import com.android.volley.toolbox.Volley ;
public class AppController extends Application {
public static final String TAG = AppController . class . getSimpleName ();
private RequestQueue mRequestQueue ;
private ImageLoader mImageLoader ;
private static AppController mInstance ;
@Override
public void onCreate () {
super . onCreate ();
mInstance = this ;
}
public static synchronized AppController getInstance () {
return mInstance ;
}
public RequestQueue getRequestQueue () {
if ( mRequestQueue == null ) {
mRequestQueue = Volley . newRequestQueue ( getApplicationContext ());
}
return mRequestQueue ;
}
public ImageLoader getImageLoader () {
getRequestQueue ();
if ( mImageLoader == null ) {
mImageLoader = new ImageLoader ( this . mRequestQueue ,
new LruBitmapCache ());
}
return this . mImageLoader ;
}
public < T > void addToRequestQueue ( Request < T > req , String tag ) {
// set the default tag if tag is empty
req . setTag ( TextUtils . isEmpty ( tag ) ? TAG : tag );
getRequestQueue (). add ( req );
}
public < T > void addToRequestQueue ( Request < T > req ) {
req . setTag ( TAG );
getRequestQueue (). add ( req );
}
public void cancelPendingRequests ( Object tag ) {
if ( mRequestQueue != null ) {
mRequestQueue . cancelAll ( tag );
}
}
}
 来自CODE的代码片
AppController.java
11.现在我们要在  AndroidManifest.xml  中注册这个AppController,并且添加上网络权限
<a target=_blank id="L1" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L1" rel="#L1" style="color: rgb(102, 102, 102); text-decoration: none;">  1</a>
<a target=_blank id="L2" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L2" rel="#L2" style="color: rgb(102, 102, 102); text-decoration: none;">  2</a>
<a target=_blank id="L3" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L3" rel="#L3" style="color: rgb(102, 102, 102); text-decoration: none;">  3</a>
<a target=_blank id="L4" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L4" rel="#L4" style="color: rgb(102, 102, 102); text-decoration: none;">  4</a>
<a target=_blank id="L5" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L5" rel="#L5" style="color: rgb(102, 102, 102); text-decoration: none;">  5</a>
<a target=_blank id="L6" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L6" rel="#L6" style="color: rgb(102, 102, 102); text-decoration: none;">  6</a>
<a target=_blank id="L7" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L7" rel="#L7" style="color: rgb(102, 102, 102); text-decoration: none;">  7</a>
<a target=_blank id="L8" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L8" rel="#L8" style="color: rgb(102, 102, 102); text-decoration: none;">  8</a>
<a target=_blank id="L9" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L9" rel="#L9" style="color: rgb(102, 102, 102); text-decoration: none;">  9</a>
<a target=_blank id="L10" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L10" rel="#L10" style="color: rgb(102, 102, 102); text-decoration: none;"> 10</a>
<a target=_blank id="L11" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L11" rel="#L11" style="color: rgb(102, 102, 102); text-decoration: none;"> 11</a>
<a target=_blank id="L12" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L12" rel="#L12" style="color: rgb(102, 102, 102); text-decoration: none;"> 12</a>
<a target=_blank id="L13" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L13" rel="#L13" style="color: rgb(102, 102, 102); text-decoration: none;"> 13</a>
<a target=_blank id="L14" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L14" rel="#L14" style="color: rgb(102, 102, 102); text-decoration: none;"> 14</a>
<a target=_blank id="L15" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L15" rel="#L15" style="color: rgb(102, 102, 102); text-decoration: none;"> 15</a>
<a target=_blank id="L16" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L16" rel="#L16" style="color: rgb(102, 102, 102); text-decoration: none;"> 16</a>
<a target=_blank id="L17" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L17" rel="#L17" style="color: rgb(102, 102, 102); text-decoration: none;"> 17</a>
<a target=_blank id="L18" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L18" rel="#L18" style="color: rgb(102, 102, 102); text-decoration: none;"> 18</a>
<a target=_blank id="L19" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L19" rel="#L19" style="color: rgb(102, 102, 102); text-decoration: none;"> 19</a>
<a target=_blank id="L20" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L20" rel="#L20" style="color: rgb(102, 102, 102); text-decoration: none;"> 20</a>
<a target=_blank id="L21" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L21" rel="#L21" style="color: rgb(102, 102, 102); text-decoration: none;"> 21</a>
<a target=_blank id="L22" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L22" rel="#L22" style="color: rgb(102, 102, 102); text-decoration: none;"> 22</a>
<a target=_blank id="L23" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L23" rel="#L23" style="color: rgb(102, 102, 102); text-decoration: none;"> 23</a>
<a target=_blank id="L24" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L24" rel="#L24" style="color: rgb(102, 102, 102); text-decoration: none;"> 24</a>
<a target=_blank id="L25" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L25" rel="#L25" style="color: rgb(102, 102, 102); text-decoration: none;"> 25</a>
<a target=_blank id="L26" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L26" rel="#L26" style="color: rgb(102, 102, 102); text-decoration: none;"> 26</a>
<a target=_blank id="L27" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L27" rel="#L27" style="color: rgb(102, 102, 102); text-decoration: none;"> 27</a>
<a target=_blank id="L28" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L28" rel="#L28" style="color: rgb(102, 102, 102); text-decoration: none;"> 28</a>
<a target=_blank id="L29" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L29" rel="#L29" style="color: rgb(102, 102, 102); text-decoration: none;"> 29</a>
<a target=_blank id="L30" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L30" rel="#L30" style="color: rgb(102, 102, 102); text-decoration: none;"> 30</a>
               
               
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android= "http://schemas.android.com/apk/res/android"
package= "info.androidhive.customlistviewvolley"
android:versionCode= "1"
android:versionName= "1.0" >
<uses-sdk
android:minSdkVersion= "11"
android:targetSdkVersion= "18" />
<uses-permission android:name= "android.permission.INTERNET" />
<application
android:name= "info.androidhive.customlistviewvolley.app.AppController"
android:allowBackup= "true"
android:icon= "@drawable/ic_launcher"
android:label= "@string/app_name"
android:theme= "@style/AppTheme" >
<activity
android:name= "info.androidhive.customlistviewvolley.MainActivity"
android:label= "@string/app_name" >
<intent-filter>
<action android:name= "android.intent.action.MAIN" />
<category android:name= "android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
 来自CODE的代码片
AndroidManifest.xml
12.现在在model包下创建一个Movie实体类,解析完的json数据会保存到这个实体类中
<a target=_blank id="L1" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L1" rel="#L1" style="color: rgb(102, 102, 102); text-decoration: none;">  1</a>
<a target=_blank id="L2" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L2" rel="#L2" style="color: rgb(102, 102, 102); text-decoration: none;">  2</a>
<a target=_blank id="L3" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L3" rel="#L3" style="color: rgb(102, 102, 102); text-decoration: none;">  3</a>
<a target=_blank id="L4" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L4" rel="#L4" style="color: rgb(102, 102, 102); text-decoration: none;">  4</a>
<a target=_blank id="L5" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L5" rel="#L5" style="color: rgb(102, 102, 102); text-decoration: none;">  5</a>
<a target=_blank id="L6" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L6" rel="#L6" style="color: rgb(102, 102, 102); text-decoration: none;">  6</a>
<a target=_blank id="L7" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L7" rel="#L7" style="color: rgb(102, 102, 102); text-decoration: none;">  7</a>
<a target=_blank id="L8" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L8" rel="#L8" style="color: rgb(102, 102, 102); text-decoration: none;">  8</a>
<a target=_blank id="L9" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L9" rel="#L9" style="color: rgb(102, 102, 102); text-decoration: none;">  9</a>
<a target=_blank id="L10" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L10" rel="#L10" style="color: rgb(102, 102, 102); text-decoration: none;"> 10</a>
<a target=_blank id="L11" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L11" rel="#L11" style="color: rgb(102, 102, 102); text-decoration: none;"> 11</a>
<a target=_blank id="L12" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L12" rel="#L12" style="color: rgb(102, 102, 102); text-decoration: none;"> 12</a>
<a target=_blank id="L13" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L13" rel="#L13" style="color: rgb(102, 102, 102); text-decoration: none;"> 13</a>
<a target=_blank id="L14" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L14" rel="#L14" style="color: rgb(102, 102, 102); text-decoration: none;"> 14</a>
<a target=_blank id="L15" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L15" rel="#L15" style="color: rgb(102, 102, 102); text-decoration: none;"> 15</a>
<a target=_blank id="L16" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L16" rel="#L16" style="color: rgb(102, 102, 102); text-decoration: none;"> 16</a>
<a target=_blank id="L17" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L17" rel="#L17" style="color: rgb(102, 102, 102); text-decoration: none;"> 17</a>
<a target=_blank id="L18" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L18" rel="#L18" style="color: rgb(102, 102, 102); text-decoration: none;"> 18</a>
<a target=_blank id="L19" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L19" rel="#L19" style="color: rgb(102, 102, 102); text-decoration: none;"> 19</a>
<a target=_blank id="L20" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L20" rel="#L20" style="color: rgb(102, 102, 102); text-decoration: none;"> 20</a>
<a target=_blank id="L21" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L21" rel="#L21" style="color: rgb(102, 102, 102); text-decoration: none;"> 21</a>
<a target=_blank id="L22" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L22" rel="#L22" style="color: rgb(102, 102, 102); text-decoration: none;"> 22</a>
<a target=_blank id="L23" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L23" rel="#L23" style="color: rgb(102, 102, 102); text-decoration: none;"> 23</a>
<a target=_blank id="L24" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L24" rel="#L24" style="color: rgb(102, 102, 102); text-decoration: none;"> 24</a>
<a target=_blank id="L25" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L25" rel="#L25" style="color: rgb(102, 102, 102); text-decoration: none;"> 25</a>
<a target=_blank id="L26" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L26" rel="#L26" style="color: rgb(102, 102, 102); text-decoration: none;"> 26</a>
<a target=_blank id="L27" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L27" rel="#L27" style="color: rgb(102, 102, 102); text-decoration: none;"> 27</a>
<a target=_blank id="L28" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L28" rel="#L28" style="color: rgb(102, 102, 102); text-decoration: none;"> 28</a>
<a target=_blank id="L29" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L29" rel="#L29" style="color: rgb(102, 102, 102); text-decoration: none;"> 29</a>
<a target=_blank id="L30" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L30" rel="#L30" style="color: rgb(102, 102, 102); text-decoration: none;"> 30</a>
<a target=_blank id="L31" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L31" rel="#L31" style="color: rgb(102, 102, 102); text-decoration: none;"> 31</a>
<a target=_blank id="L32" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L32" rel="#L32" style="color: rgb(102, 102, 102); text-decoration: none;"> 32</a>
<a target=_blank id="L33" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L33" rel="#L33" style="color: rgb(102, 102, 102); text-decoration: none;"> 33</a>
<a target=_blank id="L34" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L34" rel="#L34" style="color: rgb(102, 102, 102); text-decoration: none;"> 34</a>
<a target=_blank id="L35" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L35" rel="#L35" style="color: rgb(102, 102, 102); text-decoration: none;"> 35</a>
<a target=_blank id="L36" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L36" rel="#L36" style="color: rgb(102, 102, 102); text-decoration: none;"> 36</a>
<a target=_blank id="L37" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L37" rel="#L37" style="color: rgb(102, 102, 102); text-decoration: none;"> 37</a>
<a target=_blank id="L38" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L38" rel="#L38" style="color: rgb(102, 102, 102); text-decoration: none;"> 38</a>
<a target=_blank id="L39" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L39" rel="#L39" style="color: rgb(102, 102, 102); text-decoration: none;"> 39</a>
<a target=_blank id="L40" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L40" rel="#L40" style="color: rgb(102, 102, 102); text-decoration: none;"> 40</a>
<a target=_blank id="L41" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L41" rel="#L41" style="color: rgb(102, 102, 102); text-decoration: none;"> 41</a>
<a target=_blank id="L42" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L42" rel="#L42" style="color: rgb(102, 102, 102); text-decoration: none;"> 42</a>
<a target=_blank id="L43" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L43" rel="#L43" style="color: rgb(102, 102, 102); text-decoration: none;"> 43</a>
<a target=_blank id="L44" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L44" rel="#L44" style="color: rgb(102, 102, 102); text-decoration: none;"> 44</a>
<a target=_blank id="L45" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L45" rel="#L45" style="color: rgb(102, 102, 102); text-decoration: none;"> 45</a>
<a target=_blank id="L46" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L46" rel="#L46" style="color: rgb(102, 102, 102); text-decoration: none;"> 46</a>
<a target=_blank id="L47" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L47" rel="#L47" style="color: rgb(102, 102, 102); text-decoration: none;"> 47</a>
<a target=_blank id="L48" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L48" rel="#L48" style="color: rgb(102, 102, 102); text-decoration: none;"> 48</a>
<a target=_blank id="L49" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L49" rel="#L49" style="color: rgb(102, 102, 102); text-decoration: none;"> 49</a>
<a target=_blank id="L50" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L50" rel="#L50" style="color: rgb(102, 102, 102); text-decoration: none;"> 50</a>
<a target=_blank id="L51" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L51" rel="#L51" style="color: rgb(102, 102, 102); text-decoration: none;"> 51</a>
<a target=_blank id="L52" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L52" rel="#L52" style="color: rgb(102, 102, 102); text-decoration: none;"> 52</a>
<a target=_blank id="L53" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L53" rel="#L53" style="color: rgb(102, 102, 102); text-decoration: none;"> 53</a>
<a target=_blank id="L54" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L54" rel="#L54" style="color: rgb(102, 102, 102); text-decoration: none;"> 54</a>
<a target=_blank id="L55" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L55" rel="#L55" style="color: rgb(102, 102, 102); text-decoration: none;"> 55</a>
<a target=_blank id="L56" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L56" rel="#L56" style="color: rgb(102, 102, 102); text-decoration: none;"> 56</a>
<a target=_blank id="L57" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L57" rel="#L57" style="color: rgb(102, 102, 102); text-decoration: none;"> 57</a>
<a target=_blank id="L58" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L58" rel="#L58" style="color: rgb(102, 102, 102); text-decoration: none;"> 58</a>
<a target=_blank id="L59" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L59" rel="#L59" style="color: rgb(102, 102, 102); text-decoration: none;"> 59</a>
<a target=_blank id="L60" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L60" rel="#L60" style="color: rgb(102, 102, 102); text-decoration: none;"> 60</a>
<a target=_blank id="L61" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L61" rel="#L61" style="color: rgb(102, 102, 102); text-decoration: none;"> 61</a>
<a target=_blank id="L62" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L62" rel="#L62" style="color: rgb(102, 102, 102); text-decoration: none;"> 62</a>
<a target=_blank id="L63" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L63" rel="#L63" style="color: rgb(102, 102, 102); text-decoration: none;"> 63</a>
<a target=_blank id="L64" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L64" rel="#L64" style="color: rgb(102, 102, 102); text-decoration: none;"> 64</a>
<a target=_blank id="L65" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L65" rel="#L65" style="color: rgb(102, 102, 102); text-decoration: none;"> 65</a>
<a target=_blank id="L66" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L66" rel="#L66" style="color: rgb(102, 102, 102); text-decoration: none;"> 66</a>
<a target=_blank id="L67" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L67" rel="#L67" style="color: rgb(102, 102, 102); text-decoration: none;"> 67</a>
                
                
package info . androidhive . customlistviewvolley . model ;
import java.util.ArrayList ;
public class Movie {
//title=标题, thumbnailUrl=图片地址
private String title , thumbnailUrl ;
//年份
private int year ;
//评分
private double rating ;
//类别
private ArrayList < String > genre ;
public Movie () {
}
public Movie ( String name , String thumbnailUrl , int year , double rating ,
ArrayList < String > genre ) {
this . title = name ;
this . thumbnailUrl = thumbnailUrl ;
this . year = year ;
this . rating = rating ;
this . genre = genre ;
}
public String getTitle () {
return title ;
}
public void setTitle ( String name ) {
this . title = name ;
}
public String getThumbnailUrl () {
return thumbnailUrl ;
}
public void setThumbnailUrl ( String thumbnailUrl ) {
this . thumbnailUrl = thumbnailUrl ;
}
public int getYear () {
return year ;
}
public void setYear ( int year ) {
this . year = year ;
}
public double getRating () {
return rating ;
}
public void setRating ( double rating ) {
this . rating = rating ;
}
public ArrayList < String > getGenre () {
return genre ;
}
public void setGenre ( ArrayList < String > genre ) {
this . genre = genre ;
}
}
 来自CODE的代码片
Movie.java
13.在adapter包下新建一个  CustomListAdapter.java  adapter会将item布局加载出来,并且将数据显示到listview上面
<a target=_blank id="L1" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L1" rel="#L1" style="color: rgb(102, 102, 102); text-decoration: none;">  1</a>
<a target=_blank id="L2" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L2" rel="#L2" style="color: rgb(102, 102, 102); text-decoration: none;">  2</a>
<a target=_blank id="L3" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L3" rel="#L3" style="color: rgb(102, 102, 102); text-decoration: none;">  3</a>
<a target=_blank id="L4" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L4" rel="#L4" style="color: rgb(102, 102, 102); text-decoration: none;">  4</a>
<a target=_blank id="L5" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L5" rel="#L5" style="color: rgb(102, 102, 102); text-decoration: none;">  5</a>
<a target=_blank id="L6" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L6" rel="#L6" style="color: rgb(102, 102, 102); text-decoration: none;">  6</a>
<a target=_blank id="L7" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L7" rel="#L7" style="color: rgb(102, 102, 102); text-decoration: none;">  7</a>
<a target=_blank id="L8" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L8" rel="#L8" style="color: rgb(102, 102, 102); text-decoration: none;">  8</a>
<a target=_blank id="L9" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L9" rel="#L9" style="color: rgb(102, 102, 102); text-decoration: none;">  9</a>
<a target=_blank id="L10" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L10" rel="#L10" style="color: rgb(102, 102, 102); text-decoration: none;"> 10</a>
<a target=_blank id="L11" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L11" rel="#L11" style="color: rgb(102, 102, 102); text-decoration: none;"> 11</a>
<a target=_blank id="L12" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L12" rel="#L12" style="color: rgb(102, 102, 102); text-decoration: none;"> 12</a>
<a target=_blank id="L13" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L13" rel="#L13" style="color: rgb(102, 102, 102); text-decoration: none;"> 13</a>
<a target=_blank id="L14" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L14" rel="#L14" style="color: rgb(102, 102, 102); text-decoration: none;"> 14</a>
<a target=_blank id="L15" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L15" rel="#L15" style="color: rgb(102, 102, 102); text-decoration: none;"> 15</a>
<a target=_blank id="L16" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L16" rel="#L16" style="color: rgb(102, 102, 102); text-decoration: none;"> 16</a>
<a target=_blank id="L17" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L17" rel="#L17" style="color: rgb(102, 102, 102); text-decoration: none;"> 17</a>
<a target=_blank id="L18" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L18" rel="#L18" style="color: rgb(102, 102, 102); text-decoration: none;"> 18</a>
<a target=_blank id="L19" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L19" rel="#L19" style="color: rgb(102, 102, 102); text-decoration: none;"> 19</a>
<a target=_blank id="L20" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L20" rel="#L20" style="color: rgb(102, 102, 102); text-decoration: none;"> 20</a>
<a target=_blank id="L21" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L21" rel="#L21" style="color: rgb(102, 102, 102); text-decoration: none;"> 21</a>
<a target=_blank id="L22" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L22" rel="#L22" style="color: rgb(102, 102, 102); text-decoration: none;"> 22</a>
<a target=_blank id="L23" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L23" rel="#L23" style="color: rgb(102, 102, 102); text-decoration: none;"> 23</a>
<a target=_blank id="L24" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L24" rel="#L24" style="color: rgb(102, 102, 102); text-decoration: none;"> 24</a>
<a target=_blank id="L25" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L25" rel="#L25" style="color: rgb(102, 102, 102); text-decoration: none;"> 25</a>
<a target=_blank id="L26" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L26" rel="#L26" style="color: rgb(102, 102, 102); text-decoration: none;"> 26</a>
<a target=_blank id="L27" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L27" rel="#L27" style="color: rgb(102, 102, 102); text-decoration: none;"> 27</a>
<a target=_blank id="L28" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L28" rel="#L28" style="color: rgb(102, 102, 102); text-decoration: none;"> 28</a>
<a target=_blank id="L29" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L29" rel="#L29" style="color: rgb(102, 102, 102); text-decoration: none;"> 29</a>
<a target=_blank id="L30" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L30" rel="#L30" style="color: rgb(102, 102, 102); text-decoration: none;"> 30</a>
<a target=_blank id="L31" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L31" rel="#L31" style="color: rgb(102, 102, 102); text-decoration: none;"> 31</a>
<a target=_blank id="L32" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L32" rel="#L32" style="color: rgb(102, 102, 102); text-decoration: none;"> 32</a>
<a target=_blank id="L33" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L33" rel="#L33" style="color: rgb(102, 102, 102); text-decoration: none;"> 33</a>
<a target=_blank id="L34" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L34" rel="#L34" style="color: rgb(102, 102, 102); text-decoration: none;"> 34</a>
<a target=_blank id="L35" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L35" rel="#L35" style="color: rgb(102, 102, 102); text-decoration: none;"> 35</a>
<a target=_blank id="L36" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L36" rel="#L36" style="color: rgb(102, 102, 102); text-decoration: none;"> 36</a>
<a target=_blank id="L37" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L37" rel="#L37" style="color: rgb(102, 102, 102); text-decoration: none;"> 37</a>
<a target=_blank id="L38" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L38" rel="#L38" style="color: rgb(102, 102, 102); text-decoration: none;"> 38</a>
<a target=_blank id="L39" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L39" rel="#L39" style="color: rgb(102, 102, 102); text-decoration: none;"> 39</a>
<a target=_blank id="L40" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L40" rel="#L40" style="color: rgb(102, 102, 102); text-decoration: none;"> 40</a>
<a target=_blank id="L41" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L41" rel="#L41" style="color: rgb(102, 102, 102); text-decoration: none;"> 41</a>
<a target=_blank id="L42" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L42" rel="#L42" style="color: rgb(102, 102, 102); text-decoration: none;"> 42</a>
<a target=_blank id="L43" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L43" rel="#L43" style="color: rgb(102, 102, 102); text-decoration: none;"> 43</a>
<a target=_blank id="L44" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L44" rel="#L44" style="color: rgb(102, 102, 102); text-decoration: none;"> 44</a>
<a target=_blank id="L45" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L45" rel="#L45" style="color: rgb(102, 102, 102); text-decoration: none;"> 45</a>
<a target=_blank id="L46" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L46" rel="#L46" style="color: rgb(102, 102, 102); text-decoration: none;"> 46</a>
<a target=_blank id="L47" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L47" rel="#L47" style="color: rgb(102, 102, 102); text-decoration: none;"> 47</a>
<a target=_blank id="L48" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L48" rel="#L48" style="color: rgb(102, 102, 102); text-decoration: none;"> 48</a>
<a target=_blank id="L49" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L49" rel="#L49" style="color: rgb(102, 102, 102); text-decoration: none;"> 49</a>
<a target=_blank id="L50" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L50" rel="#L50" style="color: rgb(102, 102, 102); text-decoration: none;"> 50</a>
<a target=_blank id="L51" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L51" rel="#L51" style="color: rgb(102, 102, 102); text-decoration: none;"> 51</a>
<a target=_blank id="L52" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L52" rel="#L52" style="color: rgb(102, 102, 102); text-decoration: none;"> 52</a>
<a target=_blank id="L53" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L53" rel="#L53" style="color: rgb(102, 102, 102); text-decoration: none;"> 53</a>
<a target=_blank id="L54" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L54" rel="#L54" style="color: rgb(102, 102, 102); text-decoration: none;"> 54</a>
<a target=_blank id="L55" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L55" rel="#L55" style="color: rgb(102, 102, 102); text-decoration: none;"> 55</a>
<a target=_blank id="L56" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L56" rel="#L56" style="color: rgb(102, 102, 102); text-decoration: none;"> 56</a>
<a target=_blank id="L57" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L57" rel="#L57" style="color: rgb(102, 102, 102); text-decoration: none;"> 57</a>
<a target=_blank id="L58" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L58" rel="#L58" style="color: rgb(102, 102, 102); text-decoration: none;"> 58</a>
<a target=_blank id="L59" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L59" rel="#L59" style="color: rgb(102, 102, 102); text-decoration: none;"> 59</a>
<a target=_blank id="L60" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L60" rel="#L60" style="color: rgb(102, 102, 102); text-decoration: none;"> 60</a>
<a target=_blank id="L61" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L61" rel="#L61" style="color: rgb(102, 102, 102); text-decoration: none;"> 61</a>
<a target=_blank id="L62" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L62" rel="#L62" style="color: rgb(102, 102, 102); text-decoration: none;"> 62</a>
<a target=_blank id="L63" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L63" rel="#L63" style="color: rgb(102, 102, 102); text-decoration: none;"> 63</a>
<a target=_blank id="L64" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L64" rel="#L64" style="color: rgb(102, 102, 102); text-decoration: none;"> 64</a>
<a target=_blank id="L65" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L65" rel="#L65" style="color: rgb(102, 102, 102); text-decoration: none;"> 65</a>
<a target=_blank id="L66" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L66" rel="#L66" style="color: rgb(102, 102, 102); text-decoration: none;"> 66</a>
<a target=_blank id="L67" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L67" rel="#L67" style="color: rgb(102, 102, 102); text-decoration: none;"> 67</a>
<a target=_blank id="L68" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L68" rel="#L68" style="color: rgb(102, 102, 102); text-decoration: none;"> 68</a>
<a target=_blank id="L69" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L69" rel="#L69" style="color: rgb(102, 102, 102); text-decoration: none;"> 69</a>
<a target=_blank id="L70" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L70" rel="#L70" style="color: rgb(102, 102, 102); text-decoration: none;"> 70</a>
<a target=_blank id="L71" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L71" rel="#L71" style="color: rgb(102, 102, 102); text-decoration: none;"> 71</a>
<a target=_blank id="L72" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L72" rel="#L72" style="color: rgb(102, 102, 102); text-decoration: none;"> 72</a>
<a target=_blank id="L73" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L73" rel="#L73" style="color: rgb(102, 102, 102); text-decoration: none;"> 73</a>
<a target=_blank id="L74" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L74" rel="#L74" style="color: rgb(102, 102, 102); text-decoration: none;"> 74</a>
<a target=_blank id="L75" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L75" rel="#L75" style="color: rgb(102, 102, 102); text-decoration: none;"> 75</a>
<a target=_blank id="L76" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L76" rel="#L76" style="color: rgb(102, 102, 102); text-decoration: none;"> 76</a>
<a target=_blank id="L77" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L77" rel="#L77" style="color: rgb(102, 102, 102); text-decoration: none;"> 77</a>
<a target=_blank id="L78" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L78" rel="#L78" style="color: rgb(102, 102, 102); text-decoration: none;"> 78</a>
<a target=_blank id="L79" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L79" rel="#L79" style="color: rgb(102, 102, 102); text-decoration: none;"> 79</a>
<a target=_blank id="L80" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L80" rel="#L80" style="color: rgb(102, 102, 102); text-decoration: none;"> 80</a>
<a target=_blank id="L81" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L81" rel="#L81" style="color: rgb(102, 102, 102); text-decoration: none;"> 81</a>
<a target=_blank id="L82" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L82" rel="#L82" style="color: rgb(102, 102, 102); text-decoration: none;"> 82</a>
<a target=_blank id="L83" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L83" rel="#L83" style="color: rgb(102, 102, 102); text-decoration: none;"> 83</a>
<a target=_blank id="L84" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L84" rel="#L84" style="color: rgb(102, 102, 102); text-decoration: none;"> 84</a>
<a target=_blank id="L85" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L85" rel="#L85" style="color: rgb(102, 102, 102); text-decoration: none;"> 85</a>
<a target=_blank id="L86" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L86" rel="#L86" style="color: rgb(102, 102, 102); text-decoration: none;"> 86</a>
<a target=_blank id="L87" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L87" rel="#L87" style="color: rgb(102, 102, 102); text-decoration: none;"> 87</a>
<a target=_blank id="L88" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L88" rel="#L88" style="color: rgb(102, 102, 102); text-decoration: none;"> 88</a>
<a target=_blank id="L89" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L89" rel="#L89" style="color: rgb(102, 102, 102); text-decoration: none;"> 89</a>
<a target=_blank id="L90" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L90" rel="#L90" style="color: rgb(102, 102, 102); text-decoration: none;"> 90</a>
<a target=_blank id="L91" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L91" rel="#L91" style="color: rgb(102, 102, 102); text-decoration: none;"> 91</a>
                 
                 
package info . androidhive . customlistviewvolley . adater ;
import info.androidhive.customlistviewvolley.R ;
import info.androidhive.customlistviewvolley.app.AppController ;
import info.androidhive.customlistviewvolley.model.Movie ;
import java.util.List ;
import android.app.Activity ;
import android.content.Context ;
import android.view.LayoutInflater ;
import android.view.View ;
import android.view.ViewGroup ;
import android.widget.BaseAdapter ;
import android.widget.TextView ;
import com.android.volley.toolbox.ImageLoader ;
import com.android.volley.toolbox.NetworkImageView ;
public class CustomListAdapter extends BaseAdapter {
private Activity activity ;
private LayoutInflater inflater ;
private List < Movie > movieItems ;
ImageLoader imageLoader = AppController . getInstance (). getImageLoader ();
public CustomListAdapter ( Activity activity , List < Movie > movieItems ) {
this . activity = activity ;
this . movieItems = movieItems ;
}
@Override
public int getCount () {
return movieItems . size ();
}
@Override
public Object getItem ( int location ) {
return movieItems . get ( location );
}
@Override
public long getItemId ( int position ) {
return position ;
}
@Override
public View getView ( int position , View convertView , ViewGroup parent ) {
if ( inflater == null )
inflater = ( LayoutInflater ) activity
. getSystemService ( Context . LAYOUT_INFLATER_SERVICE );
if ( convertView == null )
convertView = inflater . inflate ( R . layout . list_row , null );
if ( imageLoader == null )
imageLoader = AppController . getInstance (). getImageLoader ();
NetworkImageView thumbNail = ( NetworkImageView ) convertView
. findViewById ( R . id . thumbnail );
TextView title = ( TextView ) convertView . findViewById ( R . id . title );
TextView rating = ( TextView ) convertView . findViewById ( R . id . rating );
TextView genre = ( TextView ) convertView . findViewById ( R . id . genre );
TextView year = ( TextView ) convertView . findViewById ( R . id . releaseYear );
// getting movie data for the row
Movie m = movieItems . get ( position );
// thumbnail image
thumbNail . setImageUrl ( m . getThumbnailUrl (), imageLoader );
// title
title . setText ( m . getTitle ());
// rating
rating . setText ( "Rating: " + String . valueOf ( m . getRating ()));
// genre
String genreStr = "" ;
for ( String str : m . getGenre ()) {
genreStr += str + ", " ;
}
genreStr = genreStr . length () > 0 ? genreStr . substring ( 0 ,
genreStr . length () - 2 ) : genreStr ;
genre . setText ( genreStr );
// release year
year . setText ( String . valueOf ( m . getYear ()));
return convertView ;
}
}
 来自CODE的代码片
CustomListAdapter.java
14.打开我们的MainActivity.java。添加如下代码,我们使用JsonArrayRequest来发送请求,发送json请求我们在 Android网络框架-Volley(四) 使用get和post方法发送json请求 已经讲过了。我们将解析来的Movie对象存储在一个ArrayList中,调用notifyDataSetChanged()方法通知listview去更新我们的数据。
<a target=_blank id="L1" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L1" rel="#L1" style="color: rgb(102, 102, 102); text-decoration: none;">   1</a>
<a target=_blank id="L2" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L2" rel="#L2" style="color: rgb(102, 102, 102); text-decoration: none;">   2</a>
<a target=_blank id="L3" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L3" rel="#L3" style="color: rgb(102, 102, 102); text-decoration: none;">   3</a>
<a target=_blank id="L4" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L4" rel="#L4" style="color: rgb(102, 102, 102); text-decoration: none;">   4</a>
<a target=_blank id="L5" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L5" rel="#L5" style="color: rgb(102, 102, 102); text-decoration: none;">   5</a>
<a target=_blank id="L6" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L6" rel="#L6" style="color: rgb(102, 102, 102); text-decoration: none;">   6</a>
<a target=_blank id="L7" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L7" rel="#L7" style="color: rgb(102, 102, 102); text-decoration: none;">   7</a>
<a target=_blank id="L8" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L8" rel="#L8" style="color: rgb(102, 102, 102); text-decoration: none;">   8</a>
<a target=_blank id="L9" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L9" rel="#L9" style="color: rgb(102, 102, 102); text-decoration: none;">   9</a>
<a target=_blank id="L10" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L10" rel="#L10" style="color: rgb(102, 102, 102); text-decoration: none;">  10</a>
<a target=_blank id="L11" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L11" rel="#L11" style="color: rgb(102, 102, 102); text-decoration: none;">  11</a>
<a target=_blank id="L12" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L12" rel="#L12" style="color: rgb(102, 102, 102); text-decoration: none;">  12</a>
<a target=_blank id="L13" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L13" rel="#L13" style="color: rgb(102, 102, 102); text-decoration: none;">  13</a>
<a target=_blank id="L14" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L14" rel="#L14" style="color: rgb(102, 102, 102); text-decoration: none;">  14</a>
<a target=_blank id="L15" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L15" rel="#L15" style="color: rgb(102, 102, 102); text-decoration: none;">  15</a>
<a target=_blank id="L16" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L16" rel="#L16" style="color: rgb(102, 102, 102); text-decoration: none;">  16</a>
<a target=_blank id="L17" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L17" rel="#L17" style="color: rgb(102, 102, 102); text-decoration: none;">  17</a>
<a target=_blank id="L18" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L18" rel="#L18" style="color: rgb(102, 102, 102); text-decoration: none;">  18</a>
<a target=_blank id="L19" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L19" rel="#L19" style="color: rgb(102, 102, 102); text-decoration: none;">  19</a>
<a target=_blank id="L20" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L20" rel="#L20" style="color: rgb(102, 102, 102); text-decoration: none;">  20</a>
<a target=_blank id="L21" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L21" rel="#L21" style="color: rgb(102, 102, 102); text-decoration: none;">  21</a>
<a target=_blank id="L22" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L22" rel="#L22" style="color: rgb(102, 102, 102); text-decoration: none;">  22</a>
<a target=_blank id="L23" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L23" rel="#L23" style="color: rgb(102, 102, 102); text-decoration: none;">  23</a>
<a target=_blank id="L24" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L24" rel="#L24" style="color: rgb(102, 102, 102); text-decoration: none;">  24</a>
<a target=_blank id="L25" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L25" rel="#L25" style="color: rgb(102, 102, 102); text-decoration: none;">  25</a>
<a target=_blank id="L26" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L26" rel="#L26" style="color: rgb(102, 102, 102); text-decoration: none;">  26</a>
<a target=_blank id="L27" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L27" rel="#L27" style="color: rgb(102, 102, 102); text-decoration: none;">  27</a>
<a target=_blank id="L28" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L28" rel="#L28" style="color: rgb(102, 102, 102); text-decoration: none;">  28</a>
<a target=_blank id="L29" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L29" rel="#L29" style="color: rgb(102, 102, 102); text-decoration: none;">  29</a>
<a target=_blank id="L30" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L30" rel="#L30" style="color: rgb(102, 102, 102); text-decoration: none;">  30</a>
<a target=_blank id="L31" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L31" rel="#L31" style="color: rgb(102, 102, 102); text-decoration: none;">  31</a>
<a target=_blank id="L32" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L32" rel="#L32" style="color: rgb(102, 102, 102); text-decoration: none;">  32</a>
<a target=_blank id="L33" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L33" rel="#L33" style="color: rgb(102, 102, 102); text-decoration: none;">  33</a>
<a target=_blank id="L34" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L34" rel="#L34" style="color: rgb(102, 102, 102); text-decoration: none;">  34</a>
<a target=_blank id="L35" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L35" rel="#L35" style="color: rgb(102, 102, 102); text-decoration: none;">  35</a>
<a target=_blank id="L36" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L36" rel="#L36" style="color: rgb(102, 102, 102); text-decoration: none;">  36</a>
<a target=_blank id="L37" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L37" rel="#L37" style="color: rgb(102, 102, 102); text-decoration: none;">  37</a>
<a target=_blank id="L38" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L38" rel="#L38" style="color: rgb(102, 102, 102); text-decoration: none;">  38</a>
<a target=_blank id="L39" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L39" rel="#L39" style="color: rgb(102, 102, 102); text-decoration: none;">  39</a>
<a target=_blank id="L40" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L40" rel="#L40" style="color: rgb(102, 102, 102); text-decoration: none;">  40</a>
<a target=_blank id="L41" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L41" rel="#L41" style="color: rgb(102, 102, 102); text-decoration: none;">  41</a>
<a target=_blank id="L42" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L42" rel="#L42" style="color: rgb(102, 102, 102); text-decoration: none;">  42</a>
<a target=_blank id="L43" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L43" rel="#L43" style="color: rgb(102, 102, 102); text-decoration: none;">  43</a>
<a target=_blank id="L44" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L44" rel="#L44" style="color: rgb(102, 102, 102); text-decoration: none;">  44</a>
<a target=_blank id="L45" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L45" rel="#L45" style="color: rgb(102, 102, 102); text-decoration: none;">  45</a>
<a target=_blank id="L46" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L46" rel="#L46" style="color: rgb(102, 102, 102); text-decoration: none;">  46</a>
<a target=_blank id="L47" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L47" rel="#L47" style="color: rgb(102, 102, 102); text-decoration: none;">  47</a>
<a target=_blank id="L48" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L48" rel="#L48" style="color: rgb(102, 102, 102); text-decoration: none;">  48</a>
<a target=_blank id="L49" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L49" rel="#L49" style="color: rgb(102, 102, 102); text-decoration: none;">  49</a>
<a target=_blank id="L50" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L50" rel="#L50" style="color: rgb(102, 102, 102); text-decoration: none;">  50</a>
<a target=_blank id="L51" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L51" rel="#L51" style="color: rgb(102, 102, 102); text-decoration: none;">  51</a>
<a target=_blank id="L52" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L52" rel="#L52" style="color: rgb(102, 102, 102); text-decoration: none;">  52</a>
<a target=_blank id="L53" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L53" rel="#L53" style="color: rgb(102, 102, 102); text-decoration: none;">  53</a>
<a target=_blank id="L54" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L54" rel="#L54" style="color: rgb(102, 102, 102); text-decoration: none;">  54</a>
<a target=_blank id="L55" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L55" rel="#L55" style="color: rgb(102, 102, 102); text-decoration: none;">  55</a>
<a target=_blank id="L56" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L56" rel="#L56" style="color: rgb(102, 102, 102); text-decoration: none;">  56</a>
<a target=_blank id="L57" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L57" rel="#L57" style="color: rgb(102, 102, 102); text-decoration: none;">  57</a>
<a target=_blank id="L58" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L58" rel="#L58" style="color: rgb(102, 102, 102); text-decoration: none;">  58</a>
<a target=_blank id="L59" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L59" rel="#L59" style="color: rgb(102, 102, 102); text-decoration: none;">  59</a>
<a target=_blank id="L60" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L60" rel="#L60" style="color: rgb(102, 102, 102); text-decoration: none;">  60</a>
<a target=_blank id="L61" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L61" rel="#L61" style="color: rgb(102, 102, 102); text-decoration: none;">  61</a>
<a target=_blank id="L62" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L62" rel="#L62" style="color: rgb(102, 102, 102); text-decoration: none;">  62</a>
<a target=_blank id="L63" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L63" rel="#L63" style="color: rgb(102, 102, 102); text-decoration: none;">  63</a>
<a target=_blank id="L64" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L64" rel="#L64" style="color: rgb(102, 102, 102); text-decoration: none;">  64</a>
<a target=_blank id="L65" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L65" rel="#L65" style="color: rgb(102, 102, 102); text-decoration: none;">  65</a>
<a target=_blank id="L66" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L66" rel="#L66" style="color: rgb(102, 102, 102); text-decoration: none;">  66</a>
<a target=_blank id="L67" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L67" rel="#L67" style="color: rgb(102, 102, 102); text-decoration: none;">  67</a>
<a target=_blank id="L68" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L68" rel="#L68" style="color: rgb(102, 102, 102); text-decoration: none;">  68</a>
<a target=_blank id="L69" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L69" rel="#L69" style="color: rgb(102, 102, 102); text-decoration: none;">  69</a>
<a target=_blank id="L70" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L70" rel="#L70" style="color: rgb(102, 102, 102); text-decoration: none;">  70</a>
<a target=_blank id="L71" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L71" rel="#L71" style="color: rgb(102, 102, 102); text-decoration: none;">  71</a>
<a target=_blank id="L72" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L72" rel="#L72" style="color: rgb(102, 102, 102); text-decoration: none;">  72</a>
<a target=_blank id="L73" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L73" rel="#L73" style="color: rgb(102, 102, 102); text-decoration: none;">  73</a>
<a target=_blank id="L74" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L74" rel="#L74" style="color: rgb(102, 102, 102); text-decoration: none;">  74</a>
<a target=_blank id="L75" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L75" rel="#L75" style="color: rgb(102, 102, 102); text-decoration: none;">  75</a>
<a target=_blank id="L76" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L76" rel="#L76" style="color: rgb(102, 102, 102); text-decoration: none;">  76</a>
<a target=_blank id="L77" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L77" rel="#L77" style="color: rgb(102, 102, 102); text-decoration: none;">  77</a>
<a target=_blank id="L78" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L78" rel="#L78" style="color: rgb(102, 102, 102); text-decoration: none;">  78</a>
<a target=_blank id="L79" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L79" rel="#L79" style="color: rgb(102, 102, 102); text-decoration: none;">  79</a>
<a target=_blank id="L80" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L80" rel="#L80" style="color: rgb(102, 102, 102); text-decoration: none;">  80</a>
<a target=_blank id="L81" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L81" rel="#L81" style="color: rgb(102, 102, 102); text-decoration: none;">  81</a>
<a target=_blank id="L82" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L82" rel="#L82" style="color: rgb(102, 102, 102); text-decoration: none;">  82</a>
<a target=_blank id="L83" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L83" rel="#L83" style="color: rgb(102, 102, 102); text-decoration: none;">  83</a>
<a target=_blank id="L84" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L84" rel="#L84" style="color: rgb(102, 102, 102); text-decoration: none;">  84</a>
<a target=_blank id="L85" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L85" rel="#L85" style="color: rgb(102, 102, 102); text-decoration: none;">  85</a>
<a target=_blank id="L86" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L86" rel="#L86" style="color: rgb(102, 102, 102); text-decoration: none;">  86</a>
<a target=_blank id="L87" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L87" rel="#L87" style="color: rgb(102, 102, 102); text-decoration: none;">  87</a>
<a target=_blank id="L88" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L88" rel="#L88" style="color: rgb(102, 102, 102); text-decoration: none;">  88</a>
<a target=_blank id="L89" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L89" rel="#L89" style="color: rgb(102, 102, 102); text-decoration: none;">  89</a>
<a target=_blank id="L90" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L90" rel="#L90" style="color: rgb(102, 102, 102); text-decoration: none;">  90</a>
<a target=_blank id="L91" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L91" rel="#L91" style="color: rgb(102, 102, 102); text-decoration: none;">  91</a>
<a target=_blank id="L92" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L92" rel="#L92" style="color: rgb(102, 102, 102); text-decoration: none;">  92</a>
<a target=_blank id="L93" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L93" rel="#L93" style="color: rgb(102, 102, 102); text-decoration: none;">  93</a>
<a target=_blank id="L94" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L94" rel="#L94" style="color: rgb(102, 102, 102); text-decoration: none;">  94</a>
<a target=_blank id="L95" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L95" rel="#L95" style="color: rgb(102, 102, 102); text-decoration: none;">  95</a>
<a target=_blank id="L96" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L96" rel="#L96" style="color: rgb(102, 102, 102); text-decoration: none;">  96</a>
<a target=_blank id="L97" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L97" rel="#L97" style="color: rgb(102, 102, 102); text-decoration: none;">  97</a>
<a target=_blank id="L98" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L98" rel="#L98" style="color: rgb(102, 102, 102); text-decoration: none;">  98</a>
<a target=_blank id="L99" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L99" rel="#L99" style="color: rgb(102, 102, 102); text-decoration: none;">  99</a>
<a target=_blank id="L100" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L100" rel="#L100" style="color: rgb(102, 102, 102); text-decoration: none;"> 100</a>
<a target=_blank id="L101" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L101" rel="#L101" style="color: rgb(102, 102, 102); text-decoration: none;"> 101</a>
<a target=_blank id="L102" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L102" rel="#L102" style="color: rgb(102, 102, 102); text-decoration: none;"> 102</a>
<a target=_blank id="L103" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L103" rel="#L103" style="color: rgb(102, 102, 102); text-decoration: none;"> 103</a>
<a target=_blank id="L104" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L104" rel="#L104" style="color: rgb(102, 102, 102); text-decoration: none;"> 104</a>
<a target=_blank id="L105" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L105" rel="#L105" style="color: rgb(102, 102, 102); text-decoration: none;"> 105</a>
<a target=_blank id="L106" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L106" rel="#L106" style="color: rgb(102, 102, 102); text-decoration: none;"> 106</a>
<a target=_blank id="L107" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L107" rel="#L107" style="color: rgb(102, 102, 102); text-decoration: none;"> 107</a>
<a target=_blank id="L108" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L108" rel="#L108" style="color: rgb(102, 102, 102); text-decoration: none;"> 108</a>
<a target=_blank id="L109" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L109" rel="#L109" style="color: rgb(102, 102, 102); text-decoration: none;"> 109</a>
<a target=_blank id="L110" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L110" rel="#L110" style="color: rgb(102, 102, 102); text-decoration: none;"> 110</a>
<a target=_blank id="L111" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L111" rel="#L111" style="color: rgb(102, 102, 102); text-decoration: none;"> 111</a>
<a target=_blank id="L112" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L112" rel="#L112" style="color: rgb(102, 102, 102); text-decoration: none;"> 112</a>
<a target=_blank id="L113" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L113" rel="#L113" style="color: rgb(102, 102, 102); text-decoration: none;"> 113</a>
<a target=_blank id="L114" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L114" rel="#L114" style="color: rgb(102, 102, 102); text-decoration: none;"> 114</a>
<a target=_blank id="L115" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L115" rel="#L115" style="color: rgb(102, 102, 102); text-decoration: none;"> 115</a>
<a target=_blank id="L116" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L116" rel="#L116" style="color: rgb(102, 102, 102); text-decoration: none;"> 116</a>
<a target=_blank id="L117" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L117" rel="#L117" style="color: rgb(102, 102, 102); text-decoration: none;"> 117</a>
<a target=_blank id="L118" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L118" rel="#L118" style="color: rgb(102, 102, 102); text-decoration: none;"> 118</a>
<a target=_blank id="L119" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L119" rel="#L119" style="color: rgb(102, 102, 102); text-decoration: none;"> 119</a>
<a target=_blank id="L120" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L120" rel="#L120" style="color: rgb(102, 102, 102); text-decoration: none;"> 120</a>
<a target=_blank id="L121" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L121" rel="#L121" style="color: rgb(102, 102, 102); text-decoration: none;"> 121</a>
<a target=_blank id="L122" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L122" rel="#L122" style="color: rgb(102, 102, 102); text-decoration: none;"> 122</a>
<a target=_blank id="L123" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L123" rel="#L123" style="color: rgb(102, 102, 102); text-decoration: none;"> 123</a>
<a target=_blank id="L124" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L124" rel="#L124" style="color: rgb(102, 102, 102); text-decoration: none;"> 124</a>
<a target=_blank id="L125" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L125" rel="#L125" style="color: rgb(102, 102, 102); text-decoration: none;"> 125</a>
<a target=_blank id="L126" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L126" rel="#L126" style="color: rgb(102, 102, 102); text-decoration: none;"> 126</a>
<a target=_blank id="L127" href="http://blog.csdn.net/nugongahou110/article/details/46910149#L127" rel="#L127" style="color: rgb(102, 102, 102); text-decoration: none;"> 127</a>
                 
                 
package info . androidhive . customlistviewvolley ;
import info.androidhive.customlistviewvolley.adater.CustomListAdapter ;
import info.androidhive.customlistviewvolley.app.AppController ;
import info.androidhive.customlistviewvolley.model.Movie ;
import java.util.ArrayList ;
import java.util.List ;
import org.json.JSONArray ;
import org.json.JSONException ;
import org.json.JSONObject ;
import android.app.Activity ;
import android.app.ProgressDialog ;
import android.graphics.Color ;
import android.graphics.drawable.ColorDrawable ;
import android.os.Bundle ;
import android.util.Log ;
import android.view.Menu ;
import android.widget.ListView ;
import com.android.volley.Response ;
import com.android.volley.VolleyError ;
import com.android.volley.VolleyLog ;
import com.android.volley.toolbox.JsonArrayRequest ;
public class MainActivity extends Activity {
// 用来打Log日志的TAG
private static final String TAG = MainActivity . class . getSimpleName ();
// JSON地址
private static final String url = "http://api.androidhive.info/json/movies.json" ;
private ProgressDialog pDialog ;
//用来存储Movie对象的list
private List < Movie > movieList = new ArrayList < Movie >();
private ListView listView ;
private CustomListAdapter adapter ;
@Override
protected void onCreate ( Bundle savedInstanceState ) {
super . onCreate ( savedInstanceState );
setContentView ( R . layout . activity_main );
listView = ( ListView ) findViewById ( R . id . list );
adapter = new CustomListAdapter ( this , movieList );
listView . setAdapter ( adapter );
pDialog = new ProgressDialog ( this );
// 加载框
pDialog . setMessage ( "Loading..." );
pDialog . show ();
// 发送一个Json请求
JsonArrayRequest movieReq = new JsonArrayRequest ( url ,
new Response . Listener < JSONArray >() {
@Override
public void onResponse ( JSONArray response ) {
Log . d ( TAG , response . toString ());
hidePDialog ();
// 解析json数据
for ( int i = 0 ; i < response . length (); i ++) {
try {
JSONObject obj = response . getJSONObject ( i );
Movie movie = new Movie ();
movie . setTitle ( obj . getString ( "title" ));
movie . setThumbnailUrl ( obj . getString ( "image" ));
movie . setRating ((( Number ) obj . get ( "rating" ))
. doubleValue ());
movie . setYear ( obj . getInt ( "releaseYear" ));
// Genre是一个json数组
JSONArray genreArry = obj . getJSONArray ( "genre" );
ArrayList < String > genre = new ArrayList < String >();
for ( int j = 0 ; j < genreArry . length (); j ++) {
genre . add (( String ) genreArry . get ( j ));
}
movie . setGenre ( genre );
// 将解析好的一个movie对象添加到list中
movieList . add ( movie );
} catch ( JSONException e ) {
e . printStackTrace ();
}
}
// 通知listview我们的数据已经改变,现在更新
adapter . notifyDataSetChanged ();
}
}, new Response . ErrorListener () {
@Override
public void onErrorResponse ( VolleyError error ) {
VolleyLog . d ( TAG , "Error: " + error . getMessage ());
hidePDialog ();
}
});
// 将request添加到requestQueue中
AppController . getInstance (). addToRequestQueue ( movieReq );
}
@Override
public void onDestroy () {
super . onDestroy ();
hidePDialog ();
}
private void hidePDialog () {
if ( pDialog != null ) {
pDialog . dismiss ();
pDialog = null ;
}
}
@Override
public boolean onCreateOptionsMenu ( Menu menu ) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater (). inflate ( R . menu . main , menu );
return true ;
}
}
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值