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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:22:46+00:00 2026-06-10T07:22:46+00:00

Im having trouble with implementing list view inside a fragment. the xml code is:

  • 0

Im having trouble with implementing list view inside a fragment.

the xml code is:

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

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


        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:src="@drawable/jo_logo" />

    </LinearLayout>

    <ListView
        android:id="@+id/listView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1" >
    </ListView>

</LinearLayout>

simple ImageView and afterwards the list view.
I’ve already tried to implement:

ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity().getBaseContext(), 
            android.R.layout.simple_list_item_1, viewList);
    setListAdapter(adapter);

where viewList is View[], on the onCreateView function.
seems that it’s not working that way inside fragment.
thing is i need that the first view will be ImageView and second one is ListView, and all inside the Fragment.

please help, thank in advance, udi

  • 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-10T07:22:48+00:00Added an answer on June 10, 2026 at 7:22 am

    In your layout xml change android:id="@+id/listView1" to android:id="@android:id/list" otherwise the ListActivity / ListFragment won’t find your ListView.

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

Sidebar

Related Questions

I'm having trouble implementing a Stack using a linked list with struct. The program
I am having trouble implementing a sort. I have an XML document that I
I was having trouble implementing namedtuple._replace() , so I copied the code right off
I am having trouble implementing pagination onto a list of products held within a
I am having trouble implementing sorting on a list when DateTime is involved. I
I'm having trouble implementing the Facebook SDK in an iOS project and I suspect
Problem: I am having trouble implementing a recursive image lazy load in all relevant
I'm having trouble implementing a nested class who's constructor is initialized with some of
I'm having trouble implementing this step: Given I am logged in as a Facebook
I'm having trouble implementing the Facebook SDK in an iOS project. I am trying

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.