活动中的透明面板

时间:2011-07-03 22:00:18

标签: android

我正在尝试使用我的应用程序中的this教程设置透明面板,但每当我使用xml进行我的活动时,它会强制关闭

  <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
            android:id="@+id/home_container" 
            android:layout_width="fill_parent" 
            android:layout_height="fill_parent">

    <com.google.android.maps.MapView
            android:id="@+id/city_map_view" 
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" 
            android:enabled="true" 
            android:clickable="true"             
            android:apiKey="0DUEIIn35xtmC6Vk1JkFEF74kwkUjgb7HrUMKfA"/>

    <LinearLayout   xmlns:android="http://schemas.android.com/apk/res/android" 
                    android:layout_width="fill_parent" 
                    android:layout_height="fill_parent"
                    android:orientation="vertical"
                    android:gravity="bottom"
                    android:paddingLeft="5px"
                    android:paddingTop="5px"
                    android:paddingRight="5px">

        <com.pocketjourney.view.TransparentPanel
                android:id="@+id/transparent_panel" 
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:paddingTop="5px"
                android:paddingLeft="5px"
                android:paddingBottom="5px"
                android:paddingRight="5px">

            <Button android:id="@+id/button_click_me"
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content"
            android:text="Click Me!"/>

        </com.pocketjourney.view.TransparentPanel>

    </LinearLayout>
</FrameLayout>

由于

logcat的

07-04 00:14:09.874: DEBUG/ddm-heap(3005): Got feature list request
07-04 00:14:09.974: DEBUG/dalvikvm(55): GC freed 315 objects / 12176 bytes in 264ms
07-04 00:14:10.004: WARN/dalvikvm(101): disableGcForExternalAlloc: false
07-04 00:14:10.084: WARN/dalvikvm(3005): Unable to resolve superclass of Lcom/droidnova/android/howto/optionmenu/ControlMenu; (69)
07-04 00:14:10.084: WARN/dalvikvm(3005): Link of class 'Lcom/droidnova/android/howto/optionmenu/ControlMenu;' failed
07-04 00:14:10.094: DEBUG/AndroidRuntime(3005): Shutting down VM
07-04 00:14:10.094: WARN/dalvikvm(3005): threadid=3: thread exiting with uncaught exception (group=0x4001e390)
07-04 00:14:10.104: ERROR/AndroidRuntime(3005): Uncaught handler: thread main exiting due to uncaught exception
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.droidnova.android.howto.optionmenu/com.droidnova.android.howto.optionmenu.ControlMenu}: java.lang.ClassNotFoundException: com.droidnova.android.howto.optionmenu.ControlMenu in loader dalvik.system.PathClassLoader@448a0d70
07-04 00:14:10.124: ERROR/AndroidRuntime(3005):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2497)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005):     at android.app.ActivityThread.access$2200(ActivityThread.java:126)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005):     at android.os.Handler.dispatchMessage(Handler.java:99)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005):     at android.os.Looper.loop(Looper.java:123)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005):     at android.app.ActivityThread.main(ActivityThread.java:4595)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005):     at java.lang.reflect.Method.invokeNative(Native Method)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005):     at java.lang.reflect.Method.invoke(Method.java:521)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005):     at dalvik.system.NativeStart.main(Native Method)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): Caused by: java.lang.ClassNotFoundException: com.droidnova.android.howto.optionmenu.ControlMenu in loader dalvik.system.PathClassLoader@448a0d70
07-04 00:14:10.124: ERROR/AndroidRuntime(3005):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2489)

现在我得到了这个

07-04 00:28:31.914: ERROR/ActivityManager(101): fail to set top app changed!

1 个答案:

答案 0 :(得分:2)

XML声明

在package com / pocketjourney / view中说会有一个名为TransparentPanel的类

所以我假设您的软件包不是这样,您将自己命名,因此您需要更新XML

  

com.your.package.TransparentPanel