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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:06:34+00:00 2026-06-09T17:06:34+00:00

I got a problem with this code: @Override public View getView(int position, View convertView,

  • 0

I got a problem with this code:

@Override
    public View getView(int position, View convertView, ViewGroup parent) {
        LayoutInflater inflater = (LayoutInflater) context
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View rowView = inflater.inflate(R.layout.list_mobile, parent, false);
        TextView textView = (TextView) rowView.findViewById(R.id.label);
        ImageView imageView = (ImageView) rowView.findViewById(R.id.logo);
        textView.setText(values[position]);

        // Change icon based on name
        String s = values[position];

        System.out.println("s = "+s);
        System.out.println("Results = "+name[2].toString());
        for (int i = 0; i < name.length; i ++){
            if (s.equals(name[i])) {
                imageView.setImageDrawable(loadImageFromURL("http://10.0.0.117/test/"+s+".jpg", "iOS"));
            }
        }
        return rowView;
    }

And this is my XML:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:padding="5dp" >

    <ImageView
        android:id="@+id/logo"
        android:layout_width="70dp"
        android:layout_height="70dp"
        android:layout_marginLeft="5dp"
        android:layout_marginRight="20dp"
        android:layout_marginTop="5dp"
        android:contentDescription="@string/desc"
        android:src="@drawable/windowsmobile_logo" >
    </ImageView>

    <TextView
        android:id="@+id/label"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/logo"
        android:layout_marginBottom="16dp"
        android:layout_toRightOf="@+id/logo"
        android:text="@+id/label"
        android:textSize="20dp" />


    <RelativeLayout
        android:id="@+id/relativeLayout1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true" >



        <Button
            android:id="@+id/btn_zoeken"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_toRightOf="@+id/txt_zoeken"
            android:text="@string/Zoeken" />

        <EditText
            android:id="@+id/txt_zoeken"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:ems="10" >

            <requestFocus />
        </EditText>
    </RelativeLayout>

</RelativeLayout>

I got this problem:
I got a list, and at the bottom of the screen their should always be an EditText and a button. But when I add this in the layout and start the app, it places the EditText and the button at every row, see Pictures:

This is how it is (bad):

How it is now (bad)

This is how it should be:

How it should be

I got in the layout a RelativeLayout in a RelativeLayout, because I hoped it would fix this problem, but it didn’t.

Please be aware, I make a list in a relative layout, so I don’t use a ListView.
Anyone got a solution or a suggestion how to fix this?

I hope my question is clear.

Thanks already, Bigflow

Edit 1:

@Override
    public View getView(int position, View convertView, ViewGroup parent) {
        LayoutInflater inflater = (LayoutInflater) context
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);

        View rowView = inflater.inflate(R.layout.inflater, parent, false);
        TextView textView = (TextView) rowView.findViewById(R.id.label);
        ImageView imageView = (ImageView) rowView.findViewById(R.id.logo);
        Button btn_zoeken = (Button) rowView.findViewById(R.id.button1);
        textView.setText(values[position]);

        // Change icon based on name
        String s = values[position];

        System.out.println("s = "+s);
        System.out.println("Results = "+name[2].toString());
        for (int i = 0; i < name.length; i ++){
            if (s.equals(name[i])) {
                imageView.setImageDrawable(loadImageFromURL("http://10.0.0.117/test/"+s+".jpg", "iOS"));
            }
        }
        return rowView;
    }
  • 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-09T17:06:36+00:00Added an answer on June 9, 2026 at 5:06 pm

    Use your button(i.e. btn_zoeken) and Image(i.e. txt_zoeken) in your main.xml file as footer as Mohasin Naeem suggested.And use this android:layout_alignParentBottom="true".

    And inflate your list_mobile.xml to the main.xml layout file.

    So your list_mobile.xml should look like this.

     <RelativeLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/relativeLayout1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
    
      <EditText
          android:id="@+id/editText1"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:layout_toLeftOf="@+id/button1" />
    
      <Button
          android:id="@+id/button1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:layout_alignParentRight="true"
          android:text="Button" />
    
    </RelativeLayout>
    

    Where btn_zoeken and txt_zoeken should look at the bottom of main screen.
    And your inflated layout.xml should like below.

        <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:padding="5dp" >
    
    <ImageView
        android:id="@+id/logo"
        android:layout_width="70dp"
        android:layout_height="70dp"
        android:layout_marginLeft="5dp"
        android:layout_marginRight="20dp"
        android:layout_marginTop="5dp"
        android:contentDescription="@string/desc"
        android:src="@drawable/windowsmobile_logo" >
    </ImageView>
    
    <TextView
        android:id="@+id/label"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/logo"
        android:layout_marginBottom="16dp"
        android:layout_toRightOf="@+id/logo"
        android:text="@+id/label"
        android:textSize="20dp" />
     </RelativeLayout>
    

    Basically while inflating layout you need two xml files.One is your main.xml(list_mobile.xml) and another is your inflated xml

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

Sidebar

Related Questions

ok i got this problem. i have this routes: (code bit change) File:/home/dotcloud/current/config/routes.js exports.routes
I got this code today that works for jQuery v7. The problem is that
My Problem is the following. I got this code and i guess a corrupt
I've got another problem in the same code... I'm getting this error: initialization method
It's a really simple problem. I've got HTML code like this : <div> <img
Hey Guys i got this code in my Activity: public class MYAppActivity extends Activity{
I got this problem after deploying my web package to IIS: HTTP Error 500.19
Ive got this problem: Line 20 (LOOT_FromContainer(container) I need that to use as Invoke
I got this problem with AVAudioRecorder not working for me, at least from what
I've got this problem for a while now and I cannot find a solution

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.