您的位置:首页 > 其它

上拉加载

2016-03-20 20:15 183 查看
package com.example.shang;

import android.app.ListActivity;

import android.content.Intent;

import android.os.Bundle;

import android.view.View;

import android.widget.ArrayAdapter;

import android.widget.ListView;

public class MainActivity extends ListActivity {

public static final String[] options = { "ListView", "ExpandableListView", "GridView", "WebView", "ScrollView",

"Horizontal ScrollView", "ViewPager", "ListView Fragment", "WebView Advanced", "ListView in ViewPager" };

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, options));

}

@Override

protected void onListItemClick(ListView l, View v, int position, long id) {

Intent intent;

switch (position) {

default:

case 0:

intent = new Intent(this, PullToRefreshListActivity.class);

break;

// case 1:

// intent = new Intent(this, PullToRefreshExpandableListActivity.class);

// break;

// case 2:

// intent = new Intent(this, PullToRefreshGridActivity.class);

// break;

// case 3:

// intent = new Intent(this, PullToRefreshWebViewActivity.class);

// break;

// case 4:

// intent = new Intent(this, PullToRefreshScrollViewActivity.class);

// break;

// case 5:

// intent = new Intent(this, PullToRefreshHorizontalScrollViewActivity.class);

// break;

// case 6:

// intent = new Intent(this, PullToRefreshViewPagerActivity.class);

// break;

// case 7:

// intent = new Intent(this, PullToRefreshListFragmentActivity.class);

// break;

// case 8:

// intent = new Intent(this, PullToRefreshWebView2Activity.class);

// break;

// case 9:

// intent = new Intent(this, PullToRefreshListInViewPagerActivity.class);

// break;

}

startActivity(intent);

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: