我一直在android中做一个简单的页面卷曲效果项目。我提到了这个网站page curl effect
我用当地的图片导入了这个项目,当时 布局inflater异常即将到来,我提到网并解决了这个问题 添加android.support.v4.jar ...现在找不到类定义 异常即将到来,无论如何它将能够解决,但我 清除异常,另一个异常正在上升,请 任何人都可以帮助我。
这是我在pagecurlview类中所做的更改。
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.img1));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page1));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.page2));
mPages.add(BitmapFactory.decodeResource(getResources(), R.drawable.img1));
mForeground = mPages.get(0);
mBackground = mPages.get(1);
mBackground = mPages.get(2);
mBackground = mPages.get(3);
我做错了什么,请任何人帮助我
> FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start
> activity
> ComponentInfo{com.mystictreegames.pagecurl/com.mystictreegames.pagecurl.StandaloneExample}:
> android.view.InflateException: Binary XML file line #6: Error
> inflating class com.mystictreegames.pagecurl.PageCurlView at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
> at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
> at android.app.ActivityThread.access$600(ActivityThread.java:141) at
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
> at android.os.Handler.dispatchMessage(Handler.java:99) at
> android.os.Looper.loop(Looper.java:137) at
> android.app.ActivityThread.main(ActivityThread.java:5039) at
> java.lang.reflect.Method.invokeNative(Native Method) at
> java.lang.reflect.Method.invoke(Method.java:511) at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
> at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at
> dalvik.system.NativeStart.main(Native Method) Caused by:
> android.view.InflateException: Binary XML file line #6: Error
> inflating class com.mystictreegames.pagecurl.PageCurlView at
> android.view.LayoutInflater.createView(LayoutInflater.java:613) at
> android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
> at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) at
> android.view.LayoutInflater.inflate(LayoutInflater.java:489) at
> android.view.LayoutInflater.inflate(LayoutInflater.java:396) at
> android.view.LayoutInflater.inflate(LayoutInflater.java:352) at
> com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
> at android.app.Activity.setContentView(Activity.java:1881) at
> com.mystictreegames.pagecurl.StandaloneExample.onCreate(StandaloneExample.java:22)
> at android.app.Activity.performCreate(Activity.java:5104) at
> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
> at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
> ... 11 more Caused by: java.lang.reflect.InvocationTargetException at
> java.lang.reflect.Constructor.constructNative(Native Method) at
> java.lang.reflect.Constructor.newInstance(Constructor.java:417) at
> android.view.LayoutInflater.createView(LayoutInflater.java:587) ... 22
> more Caused by: java.lang.OutOfMemoryError at
> android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) at
> android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:502) at
> android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:355)
> at
> android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:378)
> at
> android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:408)
> at
> com.mystictreegames.pagecurl.PageCurlView.init(PageCurlView.java:311)
> at
> com.mystictreegames.pagecurl.PageCurlView.<init>(PageCurlView.java:233)
> ... 25 more