Java 以下代码中未打开Intent

Java 以下代码中未打开Intent,java,android,android-intent,Java,Android,Android Intent,你能帮我查一下这个吗? 我把代码中我看到需要的部分放进去,如果我忘记了其他部分,请告诉我。 我正在遵循NewBoston的教程,我被困在这里,Intent SQLView无法运行,我不知道问题出在哪里。 另外,我想使用调试器进入它,但它似乎不识别任何SQLView类 舱单: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/

你能帮我查一下这个吗? 我把代码中我看到需要的部分放进去,如果我忘记了其他部分,请告诉我。 我正在遵循NewBoston的教程,我被困在这里,Intent SQLView无法运行,我不知道问题出在哪里。 另外,我想使用调试器进入它,但它似乎不识别任何SQLView类

舱单:

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.thenewboston.travis"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="8" />

    <uses-permission android:name="android.permission.SET_WALLPAPER" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:name=".Test"
            android:label="@string/app_name" >
        </activity>
        <activity
            android:name=".Splash"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".StartingPoint"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="com.thenewboston.travis.STARTINGPOINT" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name=".Menu"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="com.thenewboston.travis.MENU" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name=".Prefs"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="com.thenewboston.travis.PREFS" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name=".AboutUs"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Dialog" >
            <intent-filter>
                <action android:name="com.thenewboston.travis.ABOUT" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name=".TextPlay"
            android:label="@string/app_name" >
        </activity>
        <activity
            android:name=".Email"
            android:label="@string/app_name" >
        </activity>
        <activity
            android:name=".Camera"
            android:label="Camera Application"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name=".OpenedClass"
            android:label="Opened Class"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name=".Data"
            android:label="Data"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name=".GFX"
            android:label="Graphic"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name=".GFXSurface"
            android:label="Graphic GFX"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name=".SoundStuff"
            android:label="Sound Stuff"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name=".Slider"
            android:label="Slider"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name=".Tabs"
            android:label="Tabs"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name=".SimpleBrowser"
            android:label="Simple Browser"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name=".Flipper"
            android:label="Simple Browser"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name=".SharedPrefs"
            android:label="Shared Preferences"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name=".InternalData"
            android:label="InternalData"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name=".ExternalData"
            android:label="ExternalData"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name=".SQLiteExample"
            android:label="SQLiteExample"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name=".SQLView"
            android:label="SQLiteView"
            android:screenOrientation="portrait" >
        </activity>        
    </application>

</manifest>
以及SQLView:

        try {
        Intent i = new Intent("com.thenewboston.travis.SQLVIEW");
        startActivity(i);
    } catch (Exception e) {
        e.printStackTrace();
        Dialog d = new Dialog(this);
        d.setTitle("Heck Yeah!");
        TextView tvi = new TextView(this);
        tvi.setText("we're fucked");
        d.setContentView(tvi);
        d.show();

    }
package com.thenewboston.travis;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class SQLView extends Activity{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.sqlview);
        TextView tv = (TextView) findViewById(R.id.tvSQLinfo);
        HotOrNot info = new HotOrNot(this);
        info.open();
        String data = info.getData();
        info.close();
        tv.setText(data);
    }
}

在你的清单中改变这个

<activity
    android:name=".SQLView"
    android:label="SQLiteView"
    android:screenOrientation="portrait" >
</activity>

为此:

<activity
    android:name=".SQLView"
    android:label="SQLiteView"
    android:screenOrientation="portrait" >
    <intent-filter>
        <action android:name="com.thenewboston.travis.SQLVIEW" />

        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
</activity>

您的清单中应该有一个intenet筛选器,您可能忘记了这一点。看看它是否有效