2011/4/16 a a <[email protected]>: > Dear all, > > There have a apk which have published on google market named > "Launcher Wall", it can launch activity from it's live wallpaper. > > So, i can launch my activity from my live wallpaper also, right? But > following exception caused when tap the live wallpaper to launch. > > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): FATAL EXCEPTION: main > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): > java.lang.RuntimeException: Unable to start activity > ComponentInfo{com.example.android.livecubes/com.example.android.livecubes.cube1.XmlSample}: > android.view.InflateException: Binary XML file line #11: Error > inflating class net.youmi.android.AdView > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1665) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1681) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > android.app.ActivityThread.access$1500(ActivityThread.java:118) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > android.app.ActivityThread$H.handleMessage(ActivityThread.java:933) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > android.os.Handler.dispatchMessage(Handler.java:99) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > android.os.Looper.loop(Looper.java:123) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > android.app.ActivityThread.main(ActivityThread.java:3701) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > java.lang.reflect.Method.invokeNative(Native Method) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > java.lang.reflect.Method.invoke(Method.java:507) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:875) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:633) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > dalvik.system.NativeStart.main(Native Method) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): Caused by: > android.view.InflateException: Binary XML file line #11: Error > inflating class net.youmi.android.AdView > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:581) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > android.view.LayoutInflater.rInflate(LayoutInflater.java:623) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > android.view.LayoutInflater.inflate(LayoutInflater.java:408) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > android.view.LayoutInflater.inflate(LayoutInflater.java:320) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > android.view.LayoutInflater.inflate(LayoutInflater.java:276) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > android.app.Activity.setContentView(Activity.java:1657) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > com.example.android.livecubes.cube1.XmlSample.onCreate(XmlSample.java:14) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1613) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): ... 11 more > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): Caused by: > java.lang.ClassNotFoundException: net.youmi.android.AdView in loader > dalvik.system.PathClassLoader[/data/app/com.example.android.livecubes-2.apk] > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > java.lang.ClassLoader.loadClass(ClassLoader.java:551) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > java.lang.ClassLoader.loadClass(ClassLoader.java:511) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > android.view.LayoutInflater.createView(LayoutInflater.java:471) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): at > android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570) > 03-01 09:45:12.005: ERROR/AndroidRuntime(4800): ... 20 more > 03-01 09:45:12.015: WARN/ActivityManager(203): Force finishing > activity com.example.android.livecubes/.cube1.XmlSample > 03-01 09:45:12.025: WARN/ActivityManager(203): Force finishing > activity com.android.wallpaper.livepicker/.LiveWallpaperPreview > 03-01 09:45:12.526: WARN/ActivityManager(203): Activity pause timeout > for HistoryRecord{408cd598 > com.example.android.livecubes/.cube1.XmlSample} > 03-01 09:45:22.606: WARN/ActivityManager(203): Activity destroy > timeout for HistoryRecord{408cd598 > com.example.android.livecubes/.cube1.XmlSample} > 03-01 09:45:32.615: WARN/ActivityManager(203): Timeout executing > service: ServiceRecord{408fdfc8 > com.example.android.livecubes/.cube1.CubeWallpaper1} > > my launch code > > case MotionEvent.ACTION_DOWN: > Log.d("harvey", "action down"); > try{ > ComponentName componentName = new > ComponentName("com.example.android.livecubes.cube1", > "com.example.android.livecubes.cube1.XmlSample"); > Because live wallpaper is not an activity, so i switch setComponent style to envoke my activity--XmlSample > Intent intent=new Intent(); > intent.setComponent(componentName); > intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); > > startActivity(intent); > Log.d("harvey", "start new activity"); > }catch (Exception e) { > // TODO: handle exception > Log.e("HelloYoumi", e.getMessage()); > } > > > AndroidManifest.xml > > <activity android:name=".XmlSample"></activity> >
-- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

