{"id":7209,"date":"2014-05-28T02:19:54","date_gmt":"2014-05-28T02:19:54","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/05\/28\/tablerow-inside-tablelayout-cause-segmentation-fault-collection-of-common-programming-errors\/"},"modified":"2014-05-28T02:19:54","modified_gmt":"2014-05-28T02:19:54","slug":"tablerow-inside-tablelayout-cause-segmentation-fault-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/05\/28\/tablerow-inside-tablelayout-cause-segmentation-fault-collection-of-common-programming-errors\/","title":{"rendered":"TableRow inside TableLayout cause segmentation fault?-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m writing an android application using sdk 2.3.3.<\/p>\n<p>I try using a TableLayout layout xml file with a TableRow inside it.<\/p>\n<p>this is the layout file:<\/p>\n<pre><code>\n\n\n\n\n\n<\/code><\/pre>\n<p>in my GameActivity onCreate() function i have the following code:<\/p>\n<pre><code>    super.onCreate(savedInstanceState);\n    setContentView(R.layout.game);\n<\/code><\/pre>\n<p>till now I used a different xml layout file that contains a datagird that worked fine. but for some reason when I load this layout file i get a segmentation fault.<\/p>\n<pre><code>08-12 15:15:56.027: D\/AndroidRuntime(1056): Shutting down VM\n08-12 15:15:56.027: W\/dalvikvm(1056): threadid=1: thread exiting with uncaught exception     (group=0x40015560)\n08-12 15:15:56.087: E\/AndroidRuntime(1056): FATAL EXCEPTION: main\n08-12 15:15:56.087: E\/AndroidRuntime(1056): java.lang.ArithmeticException: divide by     zero\n08-12 15:15:56.087: E\/AndroidRuntime(1056):     at     android.widget.TableLayout.mutateColumnsWidth(TableLayout.java:579)\n08-12 15:15:56.087: E\/AndroidRuntime(1056):     at     android.widget.TableLayout.shrinkAndStretchColumns(TableLayout.java:568)\n08-12 15:15:56.087: E\/AndroidRuntime(1056):     at     android.widget.TableLayout.measureVertical(TableLayout.java:466)\n08-12 15:15:56.087: E\/AndroidRuntime(1056):     at     android.widget.TableLayout.onMeasure(TableLayout.java:431)\n08-12 15:15:56.087: E\/AndroidRuntime(1056):     at android.view.View.measure(View.java:8313)\n08-12 15:15:56.087: E\/AndroidRuntime(1056):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)\n08-12 15:15:56.087: E\/AndroidRuntime(1056):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)\n08-12 15:15:56.087: E\/AndroidRuntime(1056):     at android.view.View.measure(View.java:8313)\n08-12 15:15:56.087: E\/AndroidRuntime(1056):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:531)\n08-12 15:15:56.087: E\/AndroidRuntime(1056):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:309)\n08-12 15:15:56.087: E\/AndroidRuntime(1056):     at android.view.View.measure(View.java:8313)\n08-12 15:15:56.087: E\/AndroidRuntime(1056):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)\n08-12 15:15:56.087: E\/AndroidRuntime(1056):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)\n08-12 15:15:56.087: E\/AndroidRuntime(1056):     at android.view.View.measure(View.java:8313)\n08-12 15:15:56.087: E\/AndroidRuntime(1056):     at android.view.ViewRoot.performTraversals(ViewRoot.java:839)\n08-12 15:15:56.087: E\/AndroidRuntime(1056):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1859)\n08-12 15:15:56.087: E\/AndroidRuntime(1056):     at android.os.Handler.dispatchMessage(Handler.java:99)\n08-12 15:15:56.087: E\/AndroidRuntime(1056):     at android.os.Looper.loop(Looper.java:123)\n08-12 15:15:56.087: E\/AndroidRuntime(1056):     at android.app.ActivityThread.main(ActivityThread.java:3683)\n08-12 15:15:56.087: E\/AndroidRuntime(1056):     at java.lang.reflect.Method.invokeNative(Native Method)\n08-12 15:15:56.087: E\/AndroidRuntime(1056):     at java.lang.reflect.Method.invoke(Method.java:507)\n08-12 15:15:56.087: E\/AndroidRuntime(1056):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)\n08-12 15:15:56.087: E\/AndroidRuntime(1056):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)\n08-12 15:15:56.087: E\/AndroidRuntime(1056):     at dalvik.system.NativeStart.main(Native Method)\n<\/code><\/pre>\n<p>in general I want to have 4 tableRows and in each one to add 4 ImageViews.<\/p>\n<p>what am I doing wrong ?<\/p>\n<p>thanks!<\/p>\n<p>Kfir<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m writing an android application using sdk 2.3.3. I try using a TableLayout layout xml file with a TableRow inside it. this is the layout file: in my GameActivity onCreate() function i have the following code: super.onCreate(savedInstanceState); setContentView(R.layout.game); till now I used a different xml layout file that contains a datagird that worked fine. but [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7209","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7209"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7209\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}