我发现以下错误:
02-20 09:57:15.324: ERROR/AndroidRuntime(1180): FATAL EXCEPTION: main
02-20 09:57:15.324: ERROR/AndroidRuntime(1180): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.INSERT dat=content://com.funfil.provider.OCR/funfildata/ }
02-20 09:57:15.324: ERROR/AndroidRuntime(1180): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1409)
02-20 09:57:15.324: ERROR/AndroidRuntime(1180): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
02-20 09:57:15.324: ERROR/AndroidRuntime(1180): at android.app.Activity.startActivityForResult(Activity.java:2827)
02-20 09:57:15.324: ERROR/AndroidRuntime(1180): at android.app.Activity.startActivity(Activity.java:2933)
02-20 09:57:15.324: ERROR/AndroidRuntime(1180): at com.funfil.OCRProjectActivity.onOptionsItemSelected(OCRProjectActivity.java:245)
02-20 09:57:15.324: ERROR/AndroidRuntime(1180): at android.app.Activity.onMenuItemSelected(Activity.java:2205)
02-20 09:57:15.324: ERROR/AndroidRuntime(1180): at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:748)
02-20 09:57:15.324: ERROR/AndroidRuntime(1180): at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:143)
02-20 09:57:15.324: ERROR/AndroidRuntime(1180): at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:855)
02-20 09:57:15.324: ERROR/AndroidRuntime(1180): at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:532)
02-20 09:57:15.324: ERROR/AndroidRuntime(1180): at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:122)
02-20 09:57:15.324: ERROR/AndroidRuntime(1180): at android.view.View$PerformClick.run(View.java:9080)
02-20 09:57:15.324: ERROR/AndroidRuntime(1180): at android.os.Handler.handleCallback(Handler.java:587)
02-20 09:57:15.324: ERROR/AndroidRuntime(1180): at android.os.Handler.dispatchMessage(Handler.java:92)
02-20 09:57:15.324: ERROR/AndroidRuntime(1180): at android.os.Looper.loop(Looper.java:130)
02-20 09:57:15.324: ERROR/AndroidRuntime(1180): at android.app.ActivityThread.main(ActivityThread.java:3683)
02-20 09:57:15.324: ERROR/AndroidRuntime(1180): at java.lang.reflect.Method.invokeNative(Native Method)
02-20 09:57:15.324: ERROR/AndroidRuntime(1180): at java.lang.reflect.Method.invoke(Method.java:507)
02-20 09:57:15.324: ERROR/AndroidRuntime(1180): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
02-20 09:57:15.324: ERROR/AndroidRuntime(1180): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
02-20 09:57:15.324: ERROR/AndroidRuntime(1180): at dalvik.system.NativeStart.main(Native Method)
我的清单文件是:---------其中funfildata是我的应用程序中的表名:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.funfil"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<provider android:name="OCRProvider"
android:authorities="com.funfil.provider.OCR"
>
</provider>
<activity android:name="OCRProjectActivity" android:label="@string/OCR_Customer_list">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT" />
<action android:name="android.intent.action.PICK" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.dir/vnd.funfil.funfildata" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/vnd.funfil.funfildata" />
</intent-filter>
</activity>
<activity android:name="OCREditor"
android:screenOrientation="sensor"
android:configChanges="keyboardHidden|orientation"
>
<!-- This filter says that we can view or edit the data of
a single note -->
<intent-filter android:label="@string/resolve_edit">
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT" />
<action android:name="com.android.notepad.action.EDIT_NOTE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/vnd.funfil.funfildata" />
</intent-filter>
<!-- This filter says that we can create a new note inside
of a directory of notes. The INSERT action creates an
empty note; the PASTE action initializes a new note from
the current contents of the clipboard. -->
<intent-filter>
<action android:name="android.intent.action.INSERT"/>
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.dir/vnd.funfil.funfildata" />
</intent-filter>
</activity>
</application>
</manifest>
我已经使用URI检查了应用程序: content://com.funfil.provider.OCR/funfildata 。
我正在将新活动称为
startActivity(new Intent(Intent.ACTION_INSERT,getIntent()。getData()));
答案 0 :(得分:0)
如果您要使用特定的uri集启动活动,则必须使用scheme在您的清单文件中定义您的活动:
<intent-filter . . . >
<data android:scheme="content" android:host"com.funfil.provider.OCR" />
</intent-filter>
答案 1 :(得分:0)
检查ContentProvider的getType("content://com.funfil.provider.OCR/funfildata/")
是否返回vnd.android.cursor.dir/vnd.funfil.funfildata