public class LauncherActivity extends ListActivity {//主页面activity点击第一个listview进入下拉刷新滑动带声音的activity
public static final String[] options = { "下拉刷新滑动带声音", "ExpandableListView(QQ分组)", "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);
}
}
//看配置文件 simple_list_item_1.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2006 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you m