다름이 아니라... 제가 뷰페이저를 이용하여.. 특정 뷰안에 리스트뷰를 넣고 싶습니다..
리스트뷰는 그리드뷰를 사용하여, 어탭터로 해놨구요..
(모든 어플리케이션 아이콘 모양을 나열한 리스트뷰)
이를.. 특정 뷰안에 넣는 방법을 모르겠습니다...ㅠㅠ;;; 어떻게 해도 안되더군요..
많은 조언 부탁드립니다...
----------------------------------------------------------------------------- 뷰페이저 코드입니다.
public class MainActivity extends Activity {
private final int COUNT=3;
private ViewPager mPager;
private BkPagerAdapter mAdapter;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main);
mPager = (ViewPager) findViewById(R.id.pager);
mAdapter = new BkPagerAdapter(getApplicationContext());
mPager.setAdapter(mAdapter);
}
private class BkPagerAdapter extends PagerAdapter {
private LayoutInflater mInflater;
private Context mContext;
public BkPagerAdapter(Context con) {
super();
mContext = con;
mInflater = LayoutInflater.from(con);
}
@Override
public int getCount() {
return COUNT;
}
@Override
public Object instantiateItem(View pager, int position) {
View v = null;
switch(position) {
case 0:
v = mInflater.inflate(R.layout.layout1, null);
break;
case 1:
v = mInflater.inflate(R.layout.grid, null);
break;
case 2:
v = mInflater.inflate(R.layout.layout3, null);
break;
}
((ViewPager)pager).addView(v,0);
return v;
}
.....
--------------------------------------------------------------- 어댑터 코드 부분입니다.
public class AppListAdapter extends BaseAdapter {
private LayoutInflater mInflater;
private List<App> mApps;
private Map<String, Drawable> mIcons;
private Drawable mStdImg;
public AppListAdapter(Context context) {
mInflater = LayoutInflater.from(context);
mStdImg = context.getResources().getDrawable(R.drawable.icon);
}
.........................
뒷부분은. 리스트뷰 관련 내용이라 뺏습니다... ㅠ;
초보라서.. 이런질문 죄송합니다. ㅠ.