当前位置: 动力学知识库 > 问答 > 编程问答 >

android - no activity found to handle intent

问题描述:

I am finding following error:

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)


My Manifest File is :--------- where funfildata is table name in my application:

<?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>


I have checked the application with URI:content://com.funfil.provider.OCR/funfildata also.

I am calling a new activity as

startActivity(new Intent(Intent.ACTION_INSERT, getIntent().getData()));

网友答案:

If you want to launch an activity using a specific set of uri, then your activity has to be defined in your manifest file using a scheme :

<intent-filter . . . >
    <data android:scheme="content" android:host"com.funfil.provider.OCR" />
</intent-filter>
网友答案:

Check that getType("content://com.funfil.provider.OCR/funfildata/") of your ContentProvider returns vnd.android.cursor.dir/vnd.funfil.funfildata

分享给朋友:
您可能感兴趣的文章:
随机阅读: