Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9273797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:11:52+00:00 2026-06-18T16:11:52+00:00

Android 2.3.3 I have a table, where in I have 12 columns and arbitrary

  • 0

Android 2.3.3

I have a table, where in I have 12 columns and arbitrary number of rows. I am using the TableLayout for the first time. I have seen few examples and written a code(Not much of it). Just to populate a row with 12 columns dynamically. But I am getting an exception.. Here are the details..

Exception :::

02-11 21:57:21.569: E/AndroidRuntime(465): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xx.xxx/com.xx.xxx.Portfolio}: android.content.res.Resources$NotFoundException: Resource ID #0x7f070037 type #0x12 is not valid
02-11 21:57:21.569: E/AndroidRuntime(465):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
02-11 21:57:21.569: E/AndroidRuntime(465):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
02-11 21:57:21.569: E/AndroidRuntime(465):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
02-11 21:57:21.569: E/AndroidRuntime(465):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
02-11 21:57:21.569: E/AndroidRuntime(465):  at android.os.Handler.dispatchMessage(Handler.java:99)
02-11 21:57:21.569: E/AndroidRuntime(465):  at android.os.Looper.loop(Looper.java:123)
02-11 21:57:21.569: E/AndroidRuntime(465):  at android.app.ActivityThread.main(ActivityThread.java:3683)
02-11 21:57:21.569: E/AndroidRuntime(465):  at java.lang.reflect.Method.invokeNative(Native Method)
02-11 21:57:21.569: E/AndroidRuntime(465):  at java.lang.reflect.Method.invoke(Method.java:507)
02-11 21:57:21.569: E/AndroidRuntime(465):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
02-11 21:57:21.569: E/AndroidRuntime(465):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
02-11 21:57:21.569: E/AndroidRuntime(465):  at dalvik.system.NativeStart.main(Native Method)
02-11 21:57:21.569: E/AndroidRuntime(465): Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f070037 type #0x12 is not valid
02-11 21:57:21.569: E/AndroidRuntime(465):  at android.content.res.Resources.loadXmlResourceParser(Resources.java:1874)
02-11 21:57:21.569: E/AndroidRuntime(465):  at android.content.res.Resources.getLayout(Resources.java:731)
02-11 21:57:21.569: E/AndroidRuntime(465):  at android.view.LayoutInflater.inflate(LayoutInflater.java:318)
02-11 21:57:21.569: E/AndroidRuntime(465):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-11 21:57:21.569: E/AndroidRuntime(465):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
02-11 21:57:21.569: E/AndroidRuntime(465):  at android.app.Activity.setContentView(Activity.java:1657)
02-11 21:57:21.569: E/AndroidRuntime(465):  at com.xx.xxx.Portfolio.dummy(Portfolio.java:47)
02-11 21:57:21.569: E/AndroidRuntime(465):  at com.xx.xxx.Portfolio.onCreate(Portfolio.java:28)
02-11 21:57:21.569: E/AndroidRuntime(465):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-11 21:57:21.569: E/AndroidRuntime(465):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
02-11 21:57:21.569: E/AndroidRuntime(465):  ... 11 more

Activity :::

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="center"
    android:orientation="vertical">

    <ScrollView
        android:id="@+id/scrollView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical" >

            <HorizontalScrollView
                android:id="@+id/horizontalScrollView1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" >

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal" >

                    <TableLayout
                        android:id="@+id/tableLayoutPorfolio"
                        android:layout_width="wrap_content"
                        android:layout_height="match_parent" >


                    </TableLayout>

                </LinearLayout>
            </HorizontalScrollView>

        </LinearLayout>
    </ScrollView>

</LinearLayout>

Java file :::

import android.app.Activity;
import android.os.Bundle;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;

public class Portfolio extends Activity{

    TableLayout tblPorfolio;
    TableRow trScript;
    TextView txtV;

    String[] dummy = {"1","12345","XYZABC","10000","10000","10000","10000","10000","10000","10000","10000","10000","10000"};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_portfolio);

        tblPorfolio = (TableLayout) findViewById(R.id.tableLayoutPorfolio);

        trScript = new TableRow(this);

        dummy();

    }

    private void dummy() {
        // TODO Auto-generated method stub

        int i = 0;
        txtV = new TextView(this);
        while(i < dummy.length)
        {

            txtV.setText(dummy[i]);
            trScript.addView(txtV);

            i++;
        }

        tblPorfolio.addView(trScript);
        setContentView(R.id.tableLayoutPorfolio);
    }
}

I have to display 12 columns in one row and some N number of such rows. All these values will be retrieved from Database and populated.

Can some one let me know, what I am doing wrong (If I was doing anything right in the first place)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T16:11:54+00:00Added an answer on June 18, 2026 at 4:11 pm

    Delete this line:

    setContentView(R.id.tableLayoutPorfolio);
    

    Because if you want to do something likt this, you need to create a layoutinflater and inflate it before you can set it as a parameter of setContentView(view).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Android 2.3.3 I have a table with N rows and N columns. For each
i am creating a new android application.i am using the table layout. I have
Using 3 rows and 4 columns I have tried to evenly space out all
I have a table layout: <TABLELAYOUT xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent> <TABLEROW> <TEXTVIEW android:layout_width=wrap_content android:layout_height=wrap_content android:text=1>
In the first time I have created one Table DEPTS . After that I
I am using the sqlite v3, i have the table which has some columns
I have a table in SQLite database of Android which has a column RANK
For Android I have two labels in a table row. I am trying to
So I have a local SQLite table breadcrumbs being created on the Android device.
I have a table named master with columns id , name , surname ,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.