在LG 4G Stylus上拍摄“无法找到默认构造函数”后Android App崩溃

在LG 4G Stylus上拍摄“无法找到默认构造函数”后Android App崩溃,第1张

概述在LG4GStylus设备上拍照后我的应用程序崩溃了.它在Galaxynexus,GalaxyS4,LG4G上运行良好.我不能把手指放在它上面,它让我发疯…我正在使用viewpager为我的图像和使用theses清单配置:<activityandroid:name="easydeal_android.MainActivity"android:configChanges="orien

在LG 4G Stylus设备上拍照后我的应用程序崩溃了.
它在galaxy nexus,galaxy S4,LG 4G上运行良好.

我不能把手指放在它上面,它让我发疯…

我正在使用vIEwpager为我的图像和使用theses清单配置:

<activity androID:name="easydeal_androID.MainActivity" androID:configChanges="orIEntation|screenSize" androID:windowsoftinputMode="adjustPan|stateHIDden">

如果有人可以帮助我,我真的很感激!

以下是异常:引起:md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable:System.NotSupportedException:无法在EasyDeal_AndroID.FragmentDetailsvehicle类型上找到默认构造函数.请提供缺少的构造函数. —&GT Java.Interop.JavaLocationException:抛出了类型’Java.Interop.JavaLocationException’的异常.

这是跟踪:

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException    at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:703)Caused by: java.lang.reflect.InvocationTargetException    at java.lang.reflect.Method.invoke(Native Method)    at java.lang.reflect.Method.invoke(Method.java:372)    at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)    ... 1 moreCaused by: md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable: System.NotSupportedException: Unable to find the default constructor on type EasyDeal_AndroID.FragmentDetailsvehicle.  Please provIDe the missing constructor. ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown.java.lang.Error: Exception of type 'java.lang.Error' was thrown.  --- End of managed exception stack trace ---java.lang.Error: Java callstack:    at mono.androID.TypeManager.n_activate(Native Method)    at mono.androID.TypeManager.Activate(TypeManager.java:7)    at md56d2061e530d4ae630a81127536162064.FragmentDetailsvehicle.<init>(FragmentDetailsvehicle.java:27)    at java.lang.reflect.Constructor.newInstance(Native Method)    at java.lang.class.newInstance(Class.java:1572)    at androID.app.Fragment.instantiate(Fragment.java:611)    at androID.app.FragmentState.instantiate(Fragment.java:104)    at androID.app.FragmentManagerImpl.restoreAllState(FragmentManager.java:1775)    at androID.app.Activity.onCreate(Activity.java:946)    at androID.support.v4.app.FragmentActivity.onCreate(FragmentActivity.java:257)    at androID.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:58)    at md56d2061e530d4ae630a81127536162064.MainActivity.n_onCreate(Native Method)    at md56d2061e530d4ae630a81127536162064.MainActivity.onCreate(MainActivity.java:36)    at androID.app.Activity.performCreate(Activity.java:6021)    at androID.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)    at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2298)    at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2405)    at androID.app.ActivityThread.access0(ActivityThread.java:155)    at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1323)    at androID.os.Handler.dispatchMessage(Handler.java:102)    at androID.os.Looper.loop(Looper.java:135)    at androID.app.ActivityThread.main(ActivityThread.java:5376)    at java.lang.reflect.Method.invoke(Native Method)    at java.lang.reflect.Method.invoke(Method.java:372)    at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)    at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:703)  --- End of inner exception stack trace ---at System.Runtime.ExceptionServices.ExceptiondispatchInfo.Throw () <0x00028>at AndroID.Runtime.jnienv.CallNonvirtualVoIDMethod (intptr,intptr,intptr,AndroID.Runtime.JValue*) <0x000e7>at AndroID.App.Activity.OnCreate (AndroID.OS.Bundle) <0x001cb>at EasyDeal_AndroID.MainActivity.OnCreate (AndroID.OS.Bundle) <0x0001f>at AndroID.App.Activity.n_OnCreate_LandroID_os_Bundle_ (intptr,intptr,intptr) <0x0005b>at (wrapper dynamic-method) object.1f7fe7fe-50ae-47b3-b6d7-d47312e8dfe6 (intptr,intptr,intptr) <0x00043>    at md56d2061e530d4ae630a81127536162064.MainActivity.n_onCreate(Native Method)    at md56d2061e530d4ae630a81127536162064.MainActivity.onCreate(MainActivity.java:36)    at androID.app.Activity.performCreate(Activity.java:6021)    at androID.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)    at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2298)    at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2405)    at androID.app.ActivityThread.access0(ActivityThread.java:155)    at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1323)    at androID.os.Handler.dispatchMessage(Handler.java:102)    at androID.os.Looper.loop(Looper.java:135)    at androID.app.ActivityThread.main(ActivityThread.java:5376)    ... 4 more

编辑:

它确实解决了这个问题,但是在拍摄了多张照片之后它仍然会崩溃:

10-23 15:57:56.783   839  1707 I windowstate: WIN DEATH: Window{2380813b u0 adnt.easydeal/md56d2061e530d4ae630a81127536162064.MainActivity}10-23 15:57:56.793   839  1682 I ActivityManager: Process adnt.easydeal (pID 2787) has dIEd10-23 15:57:56.793   839  1682 W ActivityManager: Force removing ActivityRecord{2e8c2d28 u0 adnt.easydeal/md56d2061e530d4ae630a81127536162064.MainActivity t2019}: app dIEd, no saved state

解决方法:

看起来你的FragmentDetailsvehicle类中有自定义构造函数,但是你也需要手动添加默认构造函数,即使它实际上什么也没做:

public FragmentDetailsvehicle() {}

见:https://developer.android.com/reference/android/app/Fragment.html

All subclasses of Fragment must include a public no-argument
constructor. The framework will often re-instantiate a fragment class
when needed, in particular during state restore, and needs to be able
to find this constructor to instantiate it. If the no-argument
constructor is not available, a runtime exception will occur in some
cases during state restore.

总结

以上是内存溢出为你收集整理的在LG 4G Stylus上拍摄“无法找到默认构造函数”后Android App崩溃全部内容,希望文章能够帮你解决在LG 4G Stylus上拍摄“无法找到默认构造函数”后Android App崩溃所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1115718.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存