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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:12:44+00:00 2026-05-22T01:12:44+00:00

I need to create interface that will look like order. So, there will be

  • 0

I need to create interface that will look like “order”. So, there will be header data and then there will be details. I see it as all scrollable screen. But I’m not sure what the best way to bind details.

I can see how I can:

  1. Create ListView and put header in first row – IMO UGLY code.

  2. Create ListActivity, put header on top and ListView below – no good either since header won’t scroll.

  3. I’m not sure HOW to do it but idea is to create main layout and put empty LinearLayout where details should be. Then create another Layout for details (just like I do for ListView). But I would load details and inflate those childs manually and then inject them into my LinearLayout.

Will that work? How else would you do something like that?

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-22T01:12:44+00:00Added an answer on May 22, 2026 at 1:12 am

    The simplest solution would be to add both a TextView and a ListView inside a RelativeLayout. You can actually replace the Textivew with any View (including a ViewGorup) you need.

    See how to implement it in this tutorial: http://developer.android.com/resources/tutorials/views/hello-relativelayout.html

    and check also Romain Guy’s posts for a nice comparison between LinearLayout and RelativeLayout (and good advise in general):

    http://android-developers.blogspot.com/2009/02/android-layout-tricks-1.html

    http://android-developers.blogspot.com/2009/02/android-layout-tricks-2-reusing-layouts.html

    http://android-developers.blogspot.com/2009/03/android-layout-tricks-3-optimize-with.html


    Update

    This is a (very simplified) way to create an expandable LinearLayout. Of course, instead of buttons, you will add some more interesting content…

    • File MyCustomControl.java

    .

    package com.aleadam.test;
    
    import android.content.Context;
    import android.util.AttributeSet;
    import android.view.View;
    import android.widget.Button;
    import android.widget.LinearLayout;
    import android.widget.TextView;
    
    public class MyCustomControl extends LinearLayout {
        Context context;
        Button upper, lower;
        TextView tv;
    
        public MyCustomControl(Context context) {
            super(context);
            this.context = context;
            expandLayout();
        }
    
        public MyCustomControl(Context context, AttributeSet attrs) {
            super(context, attrs);
            this.context = context;
            expandLayout();
        }
    
        private void expandLayout() {
            setOrientation (VERTICAL);
            LayoutParams lp0 = new LayoutParams(
                     LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
            LayoutParams lp1 = new LayoutParams(
                     LayoutParams.WRAP_CONTENT, 40);
            LayoutParams lp2 = new LayoutParams(
                     LayoutParams.WRAP_CONTENT, 200);
            TextView tv = new TextView(context);
            tv.setText("The title goes here");
    
            upper = new Button(context);
            upper.setText("Click to show the other button");
    
            lower = new Button(context);
            lower.setText("Click to hide this button");
            lower.setVisibility(GONE);
    
            upper.setOnClickListener(new OnClickListener () {
                public void onClick (View v) {
                    lower.setVisibility(VISIBLE);               
                }
            });
            lower.setOnClickListener(new OnClickListener () {
                public void onClick (View v) {
                    v.setVisibility(GONE);              
                }
            });      
    
            this.addView(tv, lp0);
            this.addView(upper, lp1);
            this.addView(lower, lp2);
        }
    }
    
    • File Test.java

    .

    public class Test extends Activity {
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            inflateLayout();
        }
        public void inflateLayout() {
            ScrollView scr = new ScrollView (this);
            LinearLayout ll = new LinearLayout (this);
            ll.setOrientation(LinearLayout.VERTICAL);
            ll.addView (new MyCustomControl (this));
            ll.addView (new MyCustomControl (this));
            ll.addView (new MyCustomControl (this));
            ll.addView (new MyCustomControl (this));
            scr.addView(ll);
            setContentView (scr);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create interface MultiLingual, that allows to display object's data in different
I need to create a simple application that is multi-platform that will send data
We need to create a file management interface that integrates with the clients current
I need to create an XML schema that looks something like this: <xs:element name=wrapperElement>
I need to build a user interface to edit and create xml documents that
I have a dynamic application that need to create a window interface with checkbox.
Hi I have the following interfaces that I need to create. Can you just
Need to create a custom DNS name server using C which will check against
I've been given a question that says this. Create the IPeople Interface: Teachers and
Lets say I have some domain objects that will need to be serialized/packed using

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.