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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:55:58+00:00 2026-06-12T02:55:58+00:00

I need some help creating a listview inside a layout i have. im having

  • 0

I need some help creating a listview inside a layout i have. im having torubles creating it properly.

Here is what i got so far.

item.xml

   <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<LinearLayout
    android:id="@+id/listview"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/list_selector" >


    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/gradient_bg"
        android:src="@drawable/gs3ultimate" />

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

        <TextView
            android:id="@+id/label"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/thelistarray"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textColor="#555555" />

        <TextView
            android:id="@+id/summary"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/thelistarry_details"
            android:textColor="#555555"
            android:textSize="10dp" />

    </LinearLayout>

</LinearLayout>

</LinearLayout>

Now its just a image on the left, then 2 textview, Now i believe im gonna need 2 string arrys, one for the titles and the 2nd for the details. and i think a 3rd one for the images. Is that right?

 Here some java for my list view

AndroidListViewActivity.java

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

public class AndroidListViewActivity extends ListActivity {
   @Override
   public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);

    // storing string resources into Array
    String[] list_array = getResources().getStringArray(R.array.list_array);

    // Binding resources Array to ListAdapter
    this.setListAdapter(new ArrayAdapter<String>(this, R.layout.item, R.id.label, list_array));



    ListView lv = getListView();

    // listening to single list item on click
    lv.setOnItemClickListener(new OnItemClickListener() {
      public void onItemClick(AdapterView<?> parent, View view,
          int position, long id) {


         }
       });
      }
   }

I know that my java is missing adding the details list_array_details. and i dont know how to add it so it populates. Im not yet using the onitemclick yet for my intent’s. However would i determine which one is click and what activity to launch? example. i click list item b and want to like activity “b” but when i click a it launches activity “a”

Any help would be greately appreciated, Thanks in advance.

  • 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-12T02:55:59+00:00Added an answer on June 12, 2026 at 2:55 am

    You need to have a custom adapter for this purpose to populate someother view other than a textview or multiple textviews.

    Take a look on customadapter here and here

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

Sidebar

Related Questions

Need some help to solve this. I have a gridview and inside the gridview
Ok, I'm stuck, need some help from here on... If I've got a main
I need some help creating a query for my mySQL database. I have recently
I need some help in creating report using iReport for this layout. I am
Ok need some help, I have a system I'm creating that will allow users
Having some problems with creating regular expression with subpatterns on php. Need some help.
I've got a SharePoint problem which I need some help with. I'm creating some
I have an app I'm creating and I need some help. Under the view
i need some help with creating file Im trying in the last hours to
Need some help... I have jasperserver 4.1 installed on my ubuntu. It runs via

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.