java.lang.StackOverflowError: android.view.View.isLayoutDirectionInherited -
hi getting stackoverflow error while trying add view in layout.
code:
parentofallingmt.addview(layoutinflater.inflate( r.layout.layout_dstbutton, parentofallingmt, true));
here parentofallingmt linear layout , want layout_dstbutton
child @ index 1.
prior adding layout_dstbutton
, added
parentofallingmt.addview(layoutinflater.inflate( r.layout.gmt_option_list_dst_on, null, false));
which adding properly.
following logcat output:
08-06 07:23:44.843: e/androidruntime(19513): java.lang.stackoverflowerror 08-06 07:23:44.843: e/androidruntime(19513): @ android.view.view.islayoutdirectioninherited(view.java:11756) 08-06 07:23:44.843: e/androidruntime(19513): @ android.view.viewgroup.resetresolvedlayoutdirection(viewgroup.java:5379) 08-06 07:23:44.843: e/androidruntime(19513): @ android.view.viewgroup.resetresolvedlayoutdirection(viewgroup.java:5380) 08-06 07:23:44.843: e/androidruntime(19513): @ android.view.viewgroup.resetresolvedlayoutdirection(viewgroup.java:5380) 08-06 07:23:44.843: e/androidruntime(19513): @ android.view.viewgroup.resetresolvedlayoutdirection(viewgroup.java:5380) 08-06 07:23:44.843: e/androidruntime(19513): @ android.view.viewgroup.resetresolvedlayoutdirection(viewgroup.java:5380)
the root cause of problem design/approach taking.
i using gmt_option_list_dst_on
had 34 relative layout, , within each layout had 5 views. sum , made total of 170 views, reason reason stackoverflow exception.
so choose customize listview instead of inflating multiple(170) views. listview allowed me easy way handle event , performance enhanced too.
Comments
Post a Comment