플래그먼트를 이용해서 리스트뷰를 짜고있는데 잘 안됩니다...
대략 구조는 이렇습니다. 메인 엑티비티에 버튼2개있고
버튼1을 누르면 fm1, 2를누르면 fm2 이렇게 호출합니다.
각각 플레그먼트들은 ListFragment로 상속을 받습니다.
플래그먼트 영역만 리스트뷰를 하고싶은데 onCreateView에서
View v = inflater.inflate(R.layout.fm1, container, false);
이런식으로 레이아웃지정해서 v를 리턴하면 아래 오류가 납니다...
06-25 12:21:57.690: E/AndroidRuntime(8731): Process: com.example.ftpclient, PID: 8731
06-25 12:21:57.690: E/AndroidRuntime(8731): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.ftpclient/com.example.ftpclient.DisplayActivity}: java.lang.RuntimeException: Content has view with id attribute 'android.R.id.list' that is not a ListView class
06-25 12:21:57.690: E/AndroidRuntime(8731): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2436)
06-25 12:21:57.690: E/AndroidRuntime(8731): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2495)
06-25 12:21:57.690: E/AndroidRuntime(8731): at android.app.ActivityThread.access$900(ActivityThread.java:170)
06-25 12:21:57.690: E/AndroidRuntime(8731): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1304)
06-25 12:21:57.690: E/AndroidRuntime(8731): at android.os.Handler.dispatchMessage(Handler.java:102)
06-25 12:21:57.690: E/AndroidRuntime(8731): at android.os.Looper.loop(Looper.java:146)
06-25 12:21:57.690: E/AndroidRuntime(8731): at android.app.ActivityThread.main(ActivityThread.java:5635)
06-25 12:21:57.690: E/AndroidRuntime(8731): at java.lang.reflect.Method.invokeNative(Native Method)
06-25 12:21:57.690: E/AndroidRuntime(8731): at java.lang.reflect.Method.invoke(Method.java:515)
06-25 12:21:57.690: E/AndroidRuntime(8731): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
06-25 12:21:57.690: E/AndroidRuntime(8731): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
06-25 12:21:57.690: E/AndroidRuntime(8731): at dalvik.system.NativeStart.main(Native Method)
06-25 12:21:57.690: E/AndroidRuntime(8731): Caused by: java.lang.RuntimeException: Content has view with id attribute 'android.R.id.list' that is not a ListView class
06-25 12:21:57.690: E/AndroidRuntime(8731): at android.app.ListFragment.ensureList(ListFragment.java:402)
06-25 12:21:57.690: E/AndroidRuntime(8731): at android.app.ListFragment.onViewCreated(ListFragment.java:203)
06-25 12:21:57.690: E/AndroidRuntime(8731): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:904)
06-25 12:21:57.690: E/AndroidRuntime(8731): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
06-25 12:21:57.690: E/AndroidRuntime(8731): at android.app.BackStackRecord.run(BackStackRecord.java:684)
06-25 12:21:57.690: E/AndroidRuntime(8731): at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1453)
06-25 12:21:57.690: E/AndroidRuntime(8731): at android.app.Activity.performStart(Activity.java:5589)
06-25 12:21:57.690: E/AndroidRuntime(8731): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)
06-25 12:21:57.690: E/AndroidRuntime(8731): ... 11 more
근데 문제는 플래그먼트 소스에서 onCreateView를 안하고 어뎁터불러와서 리스트를 뿌리면
오류는 안나지만 메인엑티비티 전체에 리스트가 뿌려지게됩니다...
고수님들 도와주십쇼 ㅠㅠ