Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/221.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何从一个主页打开多个xml表单_Android_Android Intent - Fatal编程技术网

Android 如何从一个主页打开多个xml表单

Android 如何从一个主页打开多个xml表单,android,android-intent,Android,Android Intent,我是android plz帮助的初学者,我有一个主页,我想在每个按钮上打开一个表单…但它只打开一个页面,其余页面会出现错误。。。。。 这是我主页的xml代码 <?xml version="1.0" encoding="utf-8"?> <SlidingDrawer xmlns:android="http://schemas.android.com/apk/res/android" android:background="@drawable/stars"

我是android plz帮助的初学者,我有一个主页,我想在每个按钮上打开一个表单…但它只打开一个页面,其余页面会出现错误。。。。。 这是我主页的xml代码

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

    <SlidingDrawer xmlns:android="http://schemas.android.com/apk/res/android"
        android:background="@drawable/stars"
        android:id="@+id/slidingDrawer1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:content="@+id/content"
        android:handle="@+id/handle" >
        <ImageView
            android:id="@+id/handle"
            android:layout_width="70dp"
            android:layout_height="70dp"
            android:src="@drawable/arrowup" />
        <LinearLayout
            android:id="@+id/content"
            android:layout_width="match_parent"
            android:layout_height="332dp"
            android:orientation="vertical" >
            <Button
                android:id="@+id/btnlenght"
                android:layout_width="192dp"
                android:layout_height="36dp"
                android:layout_marginLeft="66dp"
                android:layout_marginTop="22dp"
                android:background="#3366cc"
                android:textColor="#ffffff"
                android:text="@string/btnlenght" />

            <Button
                android:id="@+id/btnweight"
                android:layout_width="192dp"
                android:layout_height="36dp"
                android:layout_marginLeft="66dp"
                android:layout_marginTop="22dp"
                android:layout_weight="0.00"
                android:textColor="#ffffff"
                android:background="#3366cc"
                android:text="@string/btnweight" />


            <Button
                android:id="@+id/btnarea"
                android:layout_width="197dp"
                android:layout_height="36dp"
                android:layout_marginLeft="66dp"
                android:layout_marginTop="22dp"
                android:background="#3366cc"
                android:textColor="#ffffff"
                android:text="@string/btnarea" />

         <Button
         android:id="@+id/btntemperature"
         android:layout_width="197dp"
         android:layout_height="36dp"
         android:layout_marginLeft="66dp"
         android:layout_marginTop="22dp"
         android:textColor="#ffffff"
         android:background="#3366cc"
         android:text="@string/btntemperature" />
        <ImageView
        android:id="@+id/back"
        android:layout_width="74dp"
        android:layout_height="88dp"
        android:layout_marginLeft="0dp"
        android:layout_marginTop="0dp"
        android:layout_weight="0.24"
        android:src="@drawable/back" />


        </LinearLayout>

    </SlidingDrawer>

}

将您在标记内的清单文件中调用的所有活动声明为

<activity android:name=".temperature"/>
<activity android:name=".weight"/>

或者,如果您在不同的包中使用这些类,那么您必须将包声明为

<activity android:name="com.org.xxx.temperature">
<activity android:name="com.org.xxx.weight">


检查清单文件。这可能会对您有所帮助…

哪些页面会给您带来错误,哪些页面有效?您会遇到什么错误?你能发布它吗?长度页面打开了,但其余页面没有打开…致命异常:main E/AndroidRuntime(376):android.content.ActivityNotFoundException:找不到显式活动类{com.a2zunitconverter.miniproject/com.a2zunitconverter.miniproject.Area};您是否在AndroidManifest.xml中声明了此活动?2007-03 08:48:35.292:E/AndroidRuntime(376):在android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1405)07-03 08:48:35.292:E/AndroidRuntime(376):在com.android.internal.os.ZygoteInit.main(zyoteinit.java:597)07-03 08:48:35.292:E/AndroidRuntime(376):在dalvik.system.NativeStart.main(本机方法)从您的错误日志中,我认为您需要将所有您的活动添加到清单文件中。
<activity android:name="com.org.xxx.temperature">
<activity android:name="com.org.xxx.weight">