在Android中调用类,如SurfaceView示例

时间:2012-02-10 03:57:01

标签: android android-manifest android-button

我在Android SurfaceViewExample.java中有一个类,我无法从我的调用它 滚动视图控件。我想知道如何从androidManifest.xml

调用我的类SurfaceViewExample.java

我将很感激每个人的帮助。

我附上了我的AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.empressphalanx.thebasics"
android:versionCode="1"
android:versionName="1.0" >

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

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

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".main"
        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=".menu"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="com.empressphalanx.thebasics.MENU" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name=".TutorialOne"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="com.empressphalanx.thebasics.TUTORIALONE" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name=".TutorialTwo"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="com.empressphalanx.thebasics.TUTORIALTWO" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name=".TutorialThree"
        android:label="@string/app_name"
        android:screenOrientation="portrait" >
        <intent-filter>
            <action android:name="com.empressphalanx.thebasics.TUTORIALTHREE" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name=".TutorialFour"
        android:label="@string/app_name"
        android:screenOrientation="portrait" >
        <intent-filter>
            <action android:name="com.empressphalanx.thebasics.TUTORIALFOUR" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name=".SurfaceViewExample"
        android:label="@string/app_name"
        android:screenOrientation="portrait" >
        <intent-filter>
            <action android:name="com.empressphalanx.thebasics.SURFACEVIEWEXAMPLE" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name=".Sweet"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Dialog" >
        <intent-filter>
            <action android:name="com.empressphalanx.thebasics.SWEET" />

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

</manifest>

我还包括我的menu.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="@drawable/empphx1"
        android:orientation="vertical" >
   <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello" />
   <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:text="This is a whatsup" />

   <ScrollView
        android:layout_width="fill_parent"
        android:layout_height="195dp" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <Button
            android:id="@+id/tutorial1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="Radio Buttons"
            android:textSize="25dp"
            android:textStyle="bold" />

        <Button
            android:id="@+id/tutorial2"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.00"
            android:text="List View"
            android:textSize="25dp"
            android:textStyle="bold" />

        <Button
            android:id="@+id/tutorial3"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.00"
            android:text="Wallpaper App"
            android:textSize="25dp"
            android:textStyle="bold" />

        <Button
            android:id="@+id/tutorial4"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.00"
            android:text="Graphics View App"
            android:textSize="25dp"
            android:textStyle="bold" />

        <Button
            android:id="@+id/tutorial5"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.00"
            android:text="Surface View Example"
            android:textSize="25dp"
            android:textStyle="bold" />

        <Button
            android:id="@+id/tutorial6"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.00"
            android:text="Button 6"
            android:textSize="25dp"
            android:textStyle="bold" />

        <Button
            android:id="@+id/tutorial7"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.00"
            android:text="Button 7"
            android:textSize="25dp"
            android:textStyle="bold" />

        <Button
            android:id="@+id/tutorial8"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.00"
            android:text="Button 8"
            android:textSize="25dp"
            android:textStyle="bold" />
    </LinearLayout>
</ScrollView>

</LinearLayout>

1 个答案:

答案 0 :(得分:1)

称之为

<activity android:label="@string/app_name"  android:name=".SurfaceViewExample"