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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:00:56+00:00 2026-05-30T19:00:56+00:00

Friends, i have a xml file including a Sliding drawer. I setContentView in the

  • 0

Friends,

i have a xml file including a Sliding drawer.
I setContentView in the start of the application.

I create dynamically a LinearLayout in Java with a few TextViews and Edittext and add it to the application via addContentView().
The SlidingDrawer still works but LinearLayout i added via addContentView() is displayed above the SlidingDrawer.
Is there a way to make the SlidingDrawer work correct?

Heres part of my code

            setContentView(R.layout.real_time_report_layout);
            LinearLayout linearLayoutRealTimeReportActivity = new LinearLayout(ctx);


            TextView tv_questionType1 = new TextView(ctx);

    linearLayoutRealTimeReportActivity.addView(tv_questionType1);

             addContentView(linearLayoutRealTimeReportActivity, layoutParamsRealTimeReportActivity);

I m glad for any support also work around!!!

heres my xml layout

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <EditText
        android:id="@+id/et_real_time_report_description"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <requestFocus />
    </EditText>

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:layout_marginTop="20dp"
        android:orientation="horizontal"
        android:weightSum="100" >

        <Button
            android:id="@+id/b_real_time_report_send"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="50"
            android:text="@string/b_real_time_report_send" >
        </Button>

        <Button
            android:id="@+id/b_real_time_report_cancel"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="50"
            android:text="@string/b_real_time_report_cancel" >
        </Button>
    </LinearLayout>
</LinearLayout>

<SlidingDrawer
    android:id="@+id/sd_real_time_report_layout_SlidingDrawer"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:content="@+id/content"
    android:handle="@+id/sd_real_time_report_layout_handle" >

    <Button
        android:id="@+id/sd_real_time_report_layout_handle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Handle" >
    </Button>

    <RelativeLayout
        android:id="@+id/content"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <com.google.android.maps.MapView
            android:id="@+id/mv_real_time_report"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_marginBottom="50dp"
            android:apiKey="0IfKjDM6XzpM6rGFR0H6X03Y1aWVBOnJ1C8b6wQ"
            android:clickable="true"
            android:enabled="true" />

        <TextView
            android:id="@+id/tv_real_time_report_userLocation"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="100dp"
            android:text="test"
            android:textSize="20dp" >
        </TextView>

        <Button
            android:id="@+id/b_real_time_report_deleteUserLocationPin"
            android:layout_width="wrap_content"
            android:layout_height="50dp"
            android:layout_alignParentBottom="true"
            android:layout_alignParentRight="true"
            android:text="@string/b_real_time_report_deleteUserLocationPin" />

        <ToggleButton
            android:id="@+id/tb_real_time_report_chooseLocation"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true"
            android:textOff="@string/tb_real_time_report_ChooseLocationOFF"
            android:textOn="@string/tb_real_time_report_ChooseLocationON" />
    </RelativeLayout>
</SlidingDrawer>

  • 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-30T19:00:58+00:00Added an answer on May 30, 2026 at 7:00 pm

    You need slight changes.

    • Give an id to your parent LinearLayout in layout xml (let’s say, android:id="@+id/parent_container").
    • You will get your LinearLayout in java file.

    something like this:

    LinearLayout container=(LinearLayout)this.findViewById(R.id.parent_container);
    
    • Now when adding new View to container we will use index to put view at specific index.

    something like this:

    container.addView(linearLayoutRealTimeReportActivity, container.getChildCount()-2);
    

    We substracted -2 because we want to put View at second last index.
    So SlidingDrawer is still at the last index.

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

Sidebar

Related Questions

friends, i have created custom title bar using following titlebar.xml file with code <?xml
Good day, friends. I have a PreferenceActivity, it is filled from XML file. When
I want to generate xml file from Struts action object. So that I have
Hi friends hope all r doing well. I have a problem while reading xml
Hi friends hope all r doing well. I have a problem while reading xml
I have a servlet which uses JAXB to unmarhsal and marshal an XML file,
i have 8 xml files and i am able to parse a single file
I have a program that stores it's information in an XML file. This file
hi friends i'm using Sax parser for parsing my xml file which i recieve
In Powershell, suppose I have the following xml: <Users> <User Name=Foo> <Friends> <Friend Name=Bar/>

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.