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

  • SEARCH
  • Home
  • 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 9305981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T00:03:45+00:00 2026-06-19T00:03:45+00:00

I Have a two dimensional string array , I want to create a 3

  • 0

I Have a two dimensional string array,

I want to create a 3 column list-view, that display data from the string array, it should have the same number of rows that the size of the string array.

This is my string array:

String[][] data = {
   {"001", "JOHN ","1001" },
   {"002", "SIBIN", "1002" },
   {"003", "TOM ",   "1003" },
   {"004", "FREEDY", "1004" }
   };

I want to display it in a Listview like

ID    NAME   VACANCY ID
001   JOHN    1001
002   SIBIN   1002
003   TOM     1003
004   FREEDY  1004

Also when I click a list-view item, it redirect to another page with the listview id

How is this possible? I am new in the android development, I know only the basics, and I only know how to create listview.

  • 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-19T00:03:46+00:00Added an answer on June 19, 2026 at 12:03 am

    for that you need a customize list view first you should add a listview in your main.xml(just an eg) file then create a class like this

    public class MySimpleArrayAdapter extends ArrayAdapter<String> {
          private final Context context;
          private final String[] values;
          DataHelper dh;
    
          public MySimpleArrayAdapter(Context context, int textViewResourceId, String[] values) {
            super(context, textViewResourceId, values);
            this.context = context;
            this.values = values;
    
            dh=new DataHelper(getApplicationContext());
          }
    
          @Override
          public View getView(final int position, View convertView, ViewGroup parent) {
            LayoutInflater inflater = (LayoutInflater) context
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            View rowView = inflater.inflate(R.layout.list_name, parent, false);
           textView = (TextView) rowView.findViewById(R.id.textname);
    
            textView.setText(values[position]);
            // Change the icon for Windows and iPhone
            textView.setOnClickListener(new View.OnClickListener() {
                   public void onClick(View v) 
                   {
                       Toast.makeText(this,""+values[position],10000).show();
                   }
                   });
    
    
            return rowView;
    } 
    

    R.layout.list_name this will be the new xml file which will load the contents to the list view

    and the the final step just in your on create method do this

    con = (ListView) findViewById(R.id.main_listView); 
     MySimpleArrayAdapter adapter = new MySimpleArrayAdapter(MainActivity.this,  R.id.main_listView ,data);// data is String array valu to be added in list view
        //setting the adapter
        con.setAdapter(adapter);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem related to storing data dynamically in two Dimensional String Array
I have an two dimension array that contains strings and want to create a
I have a two dimensional array that contains pairs of strings. If one string
I have the following as two ways to declare a two dimensional String array.
I have a two dimensional array public class TwoDimensions { public static void main(String[]
I have the following three arrays and need to create a new two-dimensional array
I have a two-dimensional array and want to sort it by name. I would
I have a 2D-array that I want to sort based on the second column.
Possible Duplicate: how to get two dimensional string Array from one Activity to other
I have an array that is from .split command and want to put it

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.