2013-05-29 49 views
0

我試圖從教程創建我的第一個SQLite數據庫。當我嘗試切換到保存數據庫信息的活動時,它會崩潰。我正在使用onClickListener來啓動意圖。嘗試打開視圖數據庫活動時發現「未發現處理意圖的活動」

我的意圖代碼:

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

我的清單:

<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的給我:

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) 

感謝

回答

1

您的碼10是錯的。您尚未設置要調用的另一個上下文表單正在被調用。應該是

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

請在此處發帖問題前請參考Android Developer Documentation

0

嘗試使用清單中的活動標籤內的完整軟件包名稱。 可能是您的默認包名稱不同

android:name="com.example.database.SQLView" 
相關問題