AlertDialog에서 연락처를 표시하는 데 문제가 있었으며, 문제점을 발견했지만 여전히 혼란 스럽습니다. 내 코드의 관련 의심되는 부분은 다음과 같습니다SimpleCursorAdapter가 예상하는 XML의 종류는 무엇입니까?
SimpleCursorAdapter mAdapter = new SimpleCursorAdapter(this,
android.R.layout.simple_list_item_1, mContacts,
new String[] { ContactsContract.Contacts.DISPLAY_NAME },
new int[] { android.R.id.text1 });
가 ... 이제 "simple_list_item_1는"컴파일러 (에뮬레이터에서 응용 프로그램 실행)에 의해 허용되는, 그러나 나는이 ListActivity를 실행하려고하면 , 그것은 폭탄.
그래서이 작업을 수행하는 방법에 대해 다른 곳에서 읽은 후에는 내 눈이 결국 켜져 있습니다 "simple_list_item_1"- 그 위치는 어디입니까? simple_list_item_1.xml 파일을 만들지 않았으며 내 \ res \ layout 폴더에 존재하지 않습니다. 그래서 (Eclipse에서) "simple_list_item_1"을 마우스 오른쪽 버튼으로 클릭하고 "Open Declaration"을 선택하면 "Class File Editor | Source nout found | JAR 파일"에 대한 디버그 Perspective와 비슷하거나 잘못 표시된 오류 메시지가 호출되었습니다. ... \ android.jar에 소스 첨부 파일이 없습니다. "
그래서 ...이 문제가 있다고 가정하면 (내 \ res \ layout 폴더에는 "simple_list_item_1.xml"이 없습니다) 정확히이 파일에 무엇이 있어야할까요? 각 연락처를 표시하고 싶습니까?)
다음로그 캣의 마지막 라인은 (에 도착하면 정지/죽을 것입니다 : 여기 ==============
는 일부 로그 캣 데이터입니다 ListActivity (ContactsActivity).
com.aXX3AndSpace.KeepInTouch/.KeepInTouchActivity: +5s368ms
01-08 21:54:34.020: I/ActivityManager(61): Starting: Intent { cmp=com.aXX3AndSpace.KeepInTouch/.ContactsActivity } from pid 385
... 그리고 여기에 하나의 시도 실행에 오류 MSG를 모든 주 (열 응용 프로그램은 ListActivity를 호출 할)가에서 MSG를 "이 발생해서는 안"입니다 끝 :
01-08 21:53:36.592: E/Zygote(33): setreuid() failed. errno: 2
01-08 21:53:46.423: E/Zygote(33): setreuid() failed. errno: 17
01-08 21:53:47.842: E/BatteryService(61): usbOnlinePath not found
01-08 21:53:47.842: E/BatteryService(61): batteryVoltagePath not found
01-08 21:53:47.842: E/BatteryService(61): batteryTemperaturePath not found
01-08 21:53:47.862: E/SurfaceFlinger(61): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
01-08 21:53:48.082: E/SensorService(61): couldn't open device for module sensors (Invalid argument)
01-08 21:53:53.722: E/System(61): Failure starting core service
01-08 21:53:53.722: E/System(61): java.lang.SecurityException
01-08 21:53:53.722: E/System(61): at android.os.BinderProxy.transact(Native Method)
01-08 21:53:53.722: E/System(61): at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
01-08 21:53:53.722: E/System(61): at android.os.ServiceManager.addService(ServiceManager.java:72)
01-08 21:53:53.722: E/System(61): at com.android.server.ServerThread.run(SystemServer.java:207)
01-08 21:53:53.742: E/EventHub(61): could not get driver version for /dev/input/mouse0, Not a typewriter
01-08 21:53:53.742: E/EventHub(61): could not get driver version for /dev/input/mice, Not a typewriter
01-08 21:53:54.032: E/SoundPool(61): error loading /system/media/audio/ui/Effect_Tick.ogg
01-08 21:53:54.032: E/SoundPool(61): error loading /system/media/audio/ui/KeypressStandard.ogg
01-08 21:53:54.032: E/SoundPool(61): error loading /system/media/audio/ui/KeypressSpacebar.ogg
01-08 21:53:54.042: E/SoundPool(61): error loading /system/media/audio/ui/KeypressDelete.ogg
01-08 21:53:54.042: E/SoundPool(61): error loading /system/media/audio/ui/KeypressReturn.ogg
01-08 21:53:54.703: E/ThrottleService(61): Could not open GPS configuration file /etc/gps.conf
01-08 21:53:57.172: E/logwrapper(158): executing /system/bin/tc failed: No such file or directory
01-08 21:53:57.242: E/logwrapper(159): executing /system/bin/tc failed: No such file or directory
01-08 21:53:57.282: E/logwrapper(160): executing /system/bin/tc failed: No such file or directory
01-08 21:54:00.074: E/jdwp(174): Failed sending reply to debugger: Broken pipe
01-08 21:54:00.712: E/Database(116): sqlite_config failed error_code = 21. THIS SHOULD NEVER occur.
오류가 발생할 수 있습니다? 그것은 존재 하는가? 충돌 로그를 게시하십시오 – nandeesh
어떻게 충돌 로그를 저장 하시겠습니까? "선택 줄 저장"옵션이 표시되지만 한 번에 모두 선택 (모두 선택)하는 방법이 있지만 표시되지 않습니다 ... –
예, _id 열에 액세스하고 있습니다 : 문자열 [ ] projection = new String [] {ContactsContracts.Contacts._ID, 연락처 연락처. 연락처 .DISPLAY_NAME}; ... int selectedId = mContacts.getInt (0); // _ID 열 ... Contract.Data.CONTACT_ID + "="+ selectedId, null, null); ... Contract.Data.CONTACT_ID + "selected", null, null); ... Contract.Data.CONTACT_ID + "selected", null, null); –