user2430788
user2430788

Reputation: 1

"No Activity found to handle Intent" when trying to open a view database activity

I'm attempting to create my first SQLite database from a tutorial. When I try to switch to the activity where my database info is kept it crashes. I am using an onClickListener to start the intent.

My code for the intent is:

    Intent i = new Intent("com.example.database.SQLVIEW");
        startActivity(i);

My manifest:

   <activity
        android:name=".MainActivity"
        android:label="@string/title_activity_main" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity
        android:name=".SQLView"
        android:label="@string/title_activity_main" >
        <intent-filter> 
            <action android:name="com.example.database.SQLVIEW" />    
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

LogCat gives me:

05-28 22:25:50.205: D/AndroidRuntime(688): Shutting down VM
05-28 22:25:50.205: W/dalvikvm(688): threadid=1: thread exiting with uncaught exception                 (group=0x40a13300)
05-28 22:25:50.245: E/AndroidRuntime(688): FATAL EXCEPTION: main
05-28 22:25:50.245: E/AndroidRuntime(688): android.content.ActivityNotFoundException:           No Activity found to handle Intent { act=com.example.database.SQLVIEW }
05-28 22:25:50.245: E/AndroidRuntime(688):  at     android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1545)
05-28 22:25:50.245: E/AndroidRuntime(688):  at     android.app.Instrumentation.execStartActivity(Instrumentation.java:1416)
05-28 22:25:50.245: E/AndroidRuntime(688):  at android.app.Activity.startActivityForResult(Activity.java:3351)
05-28 22:25:50.245: E/AndroidRuntime(688):  at android.app.Activity.startActivityForResult(Activity.java:3312)
05-28 22:25:50.245: E/AndroidRuntime(688):  at android.app.Activity.startActivity(Activity.java:3522)
05-28 22:25:50.245: E/AndroidRuntime(688):  at android.app.Activity.startActivity(Activity.java:3490)
05-28 22:25:50.245: E/AndroidRuntime(688):  at com.example.database.MainActivity.onClick(MainActivity.java:71)
05-28 22:25:50.245: E/AndroidRuntime(688):  at android.view.View.performClick(View.java:4084)
05-28 22:25:50.245: E/AndroidRuntime(688):  at android.view.View$PerformClick.run(View.java:16966)
05-28 22:25:50.245: E/AndroidRuntime(688):  at android.os.Handler.handleCallback(Handler.java:615)
05-28 22:25:50.245: E/AndroidRuntime(688):  at android.os.Handler.dispatchMessage(Handler.java:92)
05-28 22:25:50.245: E/AndroidRuntime(688):  at android.os.Looper.loop(Looper.java:137)
05-28 22:25:50.245: E/AndroidRuntime(688):  at android.app.ActivityThread.main(ActivityThread.java:4745)
05-28 22:25:50.245: E/AndroidRuntime(688):  at     java.lang.reflect.Method.invokeNative(Native Method)
05-28 22:25:50.245: E/AndroidRuntime(688):  at java.lang.reflect.Method.invoke(Method.java:511)
05-28 22:25:50.245: E/AndroidRuntime(688):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
05-28 22:25:50.245: E/AndroidRuntime(688):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
05-28 22:25:50.245: E/AndroidRuntime(688):  at dalvik.system.NativeStart.main(Native Method)

Thanks

Upvotes: 0

Views: 677

Answers (2)

ankita gahoi
ankita gahoi

Reputation: 1562

try to give with full package name inside activity tag in manifest. might be your default package name is different

android:name="com.example.database.SQLView"

Upvotes: 0

Karthik Balakrishnan
Karthik Balakrishnan

Reputation: 4393

Your code for intent is wrong. You haven't set a context form which the other you want to call is being called. It should be

Intent i = new Intent(YOURACTIVITY.this, SQLVIEW.class);
    startActivity(i);

Please refer to the Android Developer Documentation before you post questions here.

Upvotes: 1

Related Questions