在Android中调用SurfaceViewExample等类

发布于 2025-01-04 09:15:30 字数 7102 浏览 4 评论 0原文

我在 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>

I have a class in Android SurfaceViewExample.java, I am having trouble calling it from my
scrollview control. I want to know how do I call my class SurfaceViewExample.java from the androidManifest.xml

I will appreciate everybodys help.

I have enclosed my 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>

I am also including my 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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你的背包 2025-01-11 09:15:30

称之为

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

call this

<activity android:label="@string/app_name"  android:name=".SurfaceViewExample"  
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文