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 6867145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:16:22+00:00 2026-05-27T03:16:22+00:00

I simply want to know how to call/attach/send a table with text to a

  • 0

I simply want to know how to call/attach/send a table with text to a button. I can get ListView to work fine but I don’t know the “idea” behind a TableLayout. All I want it to do is: when the button is pressed it should go to the table and display the text. I’m not looking for anything fancy just simply display the text in a table when the button is pressed. I have a button (named buttonInfo.java)set up on a menu like this:

Button btnInfo = (Button) findViewById(R.id.buttonInfo);
    btnInfo.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            // TODO Auto-generated method stub
            startActivity(new Intent("com.crazyj.peopleinfo.BUTTONINFO"));
        }
    });

Here is the table (named infotable.xml)with the text:

<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="1">
<TableRow>
<TextView android:text="Name"
android:padding="3dip" />
<TextView android:text="John"
android:gravity="right"
android:padding="3dip" />   
</TableRow>
<TableRow>
<TextView android:text="Number"
android:padding="3dip" />
</TableRow>
<TableRow>
<TextView android:text="Age"
android:padding="3dip" />
<TextView android:text="32"
android:gravity="right"
android:padding="3dip" />
</TableRow>
</TableLayout>

buttonInfo class:

package com.crazyj.peopleinfo;

import android.content.Context;
import android.widget.TableLayout;

public class buttonInfo extends TableLayout{

public buttonInfo(Context context) {
    super(context);
    // TODO Auto-generated constructor stub
}



}

If anyone can answer this please explain what it means! I’m here to learn, not just get answers. And thanks!

  • 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-05-27T03:16:23+00:00Added an answer on May 27, 2026 at 3:16 am

    This tutorial section better illustrates what you are trying to achieve. Treat the tabs like buttons just to get the concept. It will show you how to create activity classes and invoke them using onClick

    (look around step 6)
    http://developer.android.com/resources/tutorials/views/hello-tabwidget.html

    so when you call the activity BUTTONINFO, you have to keep in mind that BUTTONINFO doesn’t exactly hold the TableLayout. So BUTTONINFO would be extending activity, since it implements an activity.

    Inside your public class for BUTTONINFO you would need

    public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.infotable);
        }
    

    this tells the activity that it needs to set this as the view. “R.layout.infotable” being where it is. (when you made the xml file, there is an android file r that updates itself to include the xml file. so infotable.xml is being called as the view.

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

Sidebar

Related Questions

Pretty straightforward, but I just want to know which is faster. I think simply
I simply want to call a swing action from my own popup menu. But
I want to know how to simply publish over http = much like Mercurial
I know it's simple to implement, but I want to reuse something that already
I simply want to show off a model in a table that is paginated
Simply put I want to call public static methods decorated with WebMethod attribute inside
I would like to know if, and how, I can call or execute what
I want to know how to open and manipulate a simple image file in
i want to know which parsing method is best to use among Simple XML
I simply want to fill-up cells in my spreadsheet from a VBA function. By

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.