java - Unknown class exception when inflating a dialog fragment in android -
java - Unknown class exception when inflating a dialog fragment in android -
this question has reply here:
strange out of memory issue while loading image bitmap object 38 answersi trying create dialog fragment. when trying show fragment, forcefulness close error stack trace hinting @ error when inflating xml files. here xml resource file.
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content"> <linearlayout android:layout_width="match_parent" android:layout_height="50dp" android:background="@color/white" android:gravity="center" android:scaletype="center"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginleft="25dp" android:text="share on" android:textcolor="@color/dark_grey" android:textsize="20sp" android:textstyle="bold" android:typeface="sans" /> </linearlayout> <view android:layout_width="match_parent" android:layout_height="1dp" android:background="#24092a" /> <linearlayout android:layout_width="match_parent" android:layout_height="80dp" android:layout_margintop="10dp" android:layout_marginbottom="5dp"> <imageview android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:id="@+id/share_dialog_facebook" android:src="@drawable/facebook_circle_icon_blue" /> <imageview android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:id="@+id/share_dialog_twitter" android:src="@drawable/twitter_circle_icon_blue" /> <imageview android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:id="@+id/share_dialog_googleplus" android:src="@drawable/google_plus_icon" /> </linearlayout> </linearlayout>
and stack trace content:
e/androidruntime﹕ fatal exception: main android.view.inflateexception: binary xml file line #9: error inflating class <unknown> @ android.view.layoutinflater.createview(layoutinflater.java:613) @ com.android.internal.policy.impl.phonelayoutinflater.oncreateview(phonelayoutinflater.java:56) @ android.view.layoutinflater.oncreateview(layoutinflater.java:660) @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:685) @ android.view.layoutinflater.rinflate(layoutinflater.java:746) @ android.view.layoutinflater.inflate(layoutinflater.java:489) @ android.view.layoutinflater.inflate(layoutinflater.java:396) @ android.view.layoutinflater.inflate(layoutinflater.java:352) @ com.shimba.android.ngoma.fragments.sharedialog.oncreatedialog(sharedialog.java:27) @ android.support.v4.app.dialogfragment.getlayoutinflater(dialogfragment.java:307) @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:942) @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:1121) @ android.support.v4.app.backstackrecord.run(backstackrecord.java:682) @ android.support.v4.app.fragmentmanagerimpl.execpendingactions(fragmentmanager.java:1484) @ android.support.v4.app.fragmentmanagerimpl$1.run(fragmentmanager.java:450) @ android.os.handler.handlecallback(handler.java:725) @ android.os.handler.dispatchmessage(handler.java:92) @ android.os.looper.loop(looper.java:137) @ android.app.activitythread.main(activitythread.java:5039) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:511) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:793) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:560) @ dalvik.system.nativestart.main(native method) caused by: java.lang.reflect.invocationtargetexception @ java.lang.reflect.constructor.constructnative(native method) @ java.lang.reflect.constructor.newinstance(constructor.java:417) @ android.view.layoutinflater.createview(layoutinflater.java:587) at com.android.internal.policy.impl.phonelayoutinflater.oncreateview(phonelayoutinflater.java:56) at android.view.layoutinflater.oncreateview(layoutinflater.java:660) at android.view.layoutinflater.createviewfromtag(layoutinflater.java:685) 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.shimba.android.ngoma.fragments.sharedialog.oncreatedialog(sharedialog.java:27) at android.support.v4.app.dialogfragment.getlayoutinflater(dialogfragment.java:307) at android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:942) at android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:1121) at android.support.v4.app.backstackrecord.run(backstackrecord.java:682) at android.support.v4.app.fragmentmanagerimpl.execpendingactions(fragmentmanager.java:1484) at android.support.v4.app.fragmentmanagerimpl$1.run(fragmentmanager.java:450) at android.os.handler.handlecallback(handler.java:725) at android.os.handler.dispatchmessage(handler.java:92) 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: java.lang.outofmemoryerror @ android.graphics.bitmapfactory.nativedecodeasset(native method) @ android.graphics.bitmapfactory.decodestream(bitmapfactory.java:502) @ android.graphics.bitmapfactory.decoderesourcestream(bitmapfactory.java:355) @ android.graphics.drawable.drawable.createfromresourcestream(drawable.java:785) @ android.content.res.resources.loaddrawable(resources.java:1965) @ android.content.res.typedarray.getdrawable(typedarray.java:601) @ android.widget.imageview.<init>(imageview.java:120) @ android.widget.imageview.<init>(imageview.java:110) 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) at com.android.internal.policy.impl.phonelayoutinflater.oncreateview(phonelayoutinflater.java:56) at android.view.layoutinflater.oncreateview(layoutinflater.java:660) at android.view.layoutinflater.createviewfromtag(layoutinflater.java:685) 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.shimba.android.ngoma.fragments.sharedialog.oncreatedialog(sharedialog.java:27) at android.support.v4.app.dialogfragment.getlayoutinflater(dialogfragment.java:307) at android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:942) at android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:1121) at android.support.v4.app.backstackrecord.run(backstackrecord.java:682) at android.support.v4.app.fragmentmanagerimpl.execpendingactions(fragmentmanager.java:1484) at android.support.v4.app.fragmentmanagerimpl$1.run(fragmentmanager.java:450) at android.os.handler.handlecallback(handler.java:725) at android.os.handler.dispatchmessage(handler.java:92) 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)
what causing problem? don't have clue. in advance.
on line 27 of sharedialog
class trying load bitmap causing outofmemory error. resize image , should go.
java android xml android-layout android-fragments
Comments
Post a Comment