SMSアプリケーションを開発していて、SMS会話を一覧表示する必要があります。uriを使用してコンテンツプロバイダーにアクセスしようとすると問題が見つかりましたcontent://mms-sms/conversations/
。Android 2.3で正常に動作しますが、Android 4.0.3 Samsung Galaxy Tab 2で実行すると、エラーが返されます。
10-17 09:04:51.035: E/AndroidRuntime(22600): FATAL EXCEPTION: main
10-17 09:04:51.035: E/AndroidRuntime(22600):
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.yooi/com.yooi.ui.MainActivity}:
android.view.InflateException: Binary XML file line #6: Error
inflating class fragment 10-17 09:04:51.035: E/AndroidRuntime(22600):
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1970)
10-17 09:04:51.035: E/AndroidRuntime(22600): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1995)
10-17 09:04:51.035: E/AndroidRuntime(22600): at
android.app.ActivityThread.access$600(ActivityThread.java:128) 10-17
09:04:51.035: E/AndroidRuntime(22600): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1161)
10-17 09:04:51.035: E/AndroidRuntime(22600): at
android.os.Handler.dispatchMessage(Handler.java:99) 10-17
09:04:51.035: E/AndroidRuntime(22600): at
android.os.Looper.loop(Looper.java:137) 10-17 09:04:51.035:
E/AndroidRuntime(22600): at
android.app.ActivityThread.main(ActivityThread.java:4514) 10-17
09:04:51.035: E/AndroidRuntime(22600): at
java.lang.reflect.Method.invokeNative(Native Method) 10-17
09:04:51.035: E/AndroidRuntime(22600): at
java.lang.reflect.Method.invoke(Method.java:511) 10-17 09:04:51.035:
E/AndroidRuntime(22600): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
10-17 09:04:51.035: E/AndroidRuntime(22600): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557) 10-17
09:04:51.035: E/AndroidRuntime(22600): at
dalvik.system.NativeStart.main(Native Method) 10-17 09:04:51.035:
E/AndroidRuntime(22600): Caused by: android.view.InflateException:
Binary XML file line #6: Error inflating class fragment 10-17
09:04:51.035: E/AndroidRuntime(22600): at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:697)
10-17 09:04:51.035: E/AndroidRuntime(22600): at
android.view.LayoutInflater.rInflate(LayoutInflater.java:739) 10-17
09:04:51.035: E/AndroidRuntime(22600): at
android.view.LayoutInflater.inflate(LayoutInflater.java:489) 10-17
09:04:51.035: E/AndroidRuntime(22600): at
android.view.LayoutInflater.inflate(LayoutInflater.java:396) 10-17
09:04:51.035: E/AndroidRuntime(22600): at
android.view.LayoutInflater.inflate(LayoutInflater.java:352) 10-17
09:04:51.035: E/AndroidRuntime(22600): at
com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:273)
10-17 09:04:51.035: E/AndroidRuntime(22600): at
android.app.Activity.setContentView(Activity.java:1835) 10-17
09:04:51.035: E/AndroidRuntime(22600): at
com.yooi.ui.MainActivity.onCreate(MainActivity.java:17) 10-17
09:04:51.035: E/AndroidRuntime(22600): at
android.app.Activity.performCreate(Activity.java:4465) 10-17
09:04:51.035: E/AndroidRuntime(22600): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1053)
10-17 09:04:51.035: E/AndroidRuntime(22600): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1934)
10-17 09:04:51.035: E/AndroidRuntime(22600): ... 11 more 10-17
09:04:51.035: E/AndroidRuntime(22600): Caused by:
java.lang.NullPointerException 10-17 09:04:51.035:
E/AndroidRuntime(22600): at
android.os.Parcel.readException(Parcel.java:1334) 10-17 09:04:51.035:
E/AndroidRuntime(22600): at
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:181)
10-17 09:04:51.035: E/AndroidRuntime(22600): at
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
10-17 09:04:51.035: E/AndroidRuntime(22600): at
android.content.ContentProviderProxy.query(ContentProviderNative.java:358)
10-17 09:04:51.035: E/AndroidRuntime(22600): at
android.content.ContentResolver.query(ContentResolver.java:311) 10-17
09:04:51.035: E/AndroidRuntime(22600): at
com.yooi.ui.SmsThreadListActivity.getThreadListCursor(SmsThreadListActivity.java:146)
10-17 09:04:51.035: E/AndroidRuntime(22600): at
com.yooi.ui.SmsThreadListActivity.onCreateView(SmsThreadListActivity.java:95)
10-17 09:04:51.035: E/AndroidRuntime(22600): at
android.app.FragmentManagerImpl.moveToState(FragmentManager.java:806)
10-17 09:04:51.035: E/AndroidRuntime(22600): at
android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1010)
10-17 09:04:51.035: E/AndroidRuntime(22600): at
android.app.FragmentManagerImpl.addFragment(FragmentManager.java:1108)
10-17 09:04:51.035: E/AndroidRuntime(22600): at
android.app.Activity.onCreateView(Activity.java:4243) 10-17
09:04:51.035: E/AndroidRuntime(22600): at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:673)
10-17 09:04:51.035: E/AndroidRuntime(22600): ... 21 more
私はグーグルでそれを検索するのに時間を費やしましたが、それでも答えが見つかりませんでした。知っている人は誰でも私を助けてください、私はこの厄介な問題のために立ち往生しています:(