Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Android
Hello guys,
 
I am using a custom layout in android but in that i am facing a problems regarding layouts.
In my main.xml 1 have one LinearLayou in that one listview is there. And another list_row.xml hase 2 textview. The code runs very well but the issue is When i add the another layout in main.xml the problem is created and the app is force close.
 
I want to add multiple layout in main.xml with multiple buttons and listview.
Here i am attaching the code for main.xml
 
MAIN.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:removed="@drawable/bg"
    android:orientation="vertical" >
 
    <RelativeLayout
        android:id="@+id/relativeLayout1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:removed="@drawable/topbar" >
 
        <Button
            android:id="@+id/btn_back1"
            android:layout_width="70dp"
            android:layout_height="50dp"
            android:background="@drawable/backbtn" />
 
        <Button
            android:id="@+id/btn_addorder"
            android:layout_width="70dp"
            android:layout_height="50dp"
            android:layout_alignParentRight="true"
            android:layout_alignParentTop="true"
            android:background="@drawable/addbtn" />
 
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="10dp"
            android:gravity="center"
            android:text="Order 1"
            android:textColor="#006699"
            android:textSize="20dp" />
    </RelativeLayout>
 
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >
 
        <ListView
            android:id="@+id/lvResult"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" />
    </LinearLayout>
 
    <RelativeLayout
        android:id="@+id/rl"
        android:layout_width="wrap_content"
        android:layout_height="35dp"
        android:layout_alignParentBottom="true"
        android:removed="@drawable/topbar"
        android:gravity="center"
        android:orientation="vertical"
        android:padding="3dp" >
 
        <TextView
            android:id="@+id/textView1"
            android:layout_width="fill_parent"
            android:layout_height="30dp"
            android:layout_alignParentBottom="true"
            android:layout_alignTop="@android:id/tabcontent"
            android:gravity="center"
            android:text="Updated at Date,Time"
            android:textSize="20dp" />
    </RelativeLayout>
 
</LinearLayout>
Posted 12-Apr-13 3:50am
Comments
Varsha Bhatia at 12-Apr-13 8:52am
   
If i am using in main.xml
 
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >

<ListView
android:id="@+id/lvResult"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
 
Its works perfact but i add multiple layout it creates a problem

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Kornfeld Eliyahu Peter 275
1 Maciej Los 214
2 Sergey Alexandrovich Kryukov 200
3 King Fisher 185
4 OriginalGriff 163
0 OriginalGriff 6,223
1 DamithSL 4,724
2 Maciej Los 4,196
3 Kornfeld Eliyahu Peter 3,894
4 Sergey Alexandrovich Kryukov 3,496


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 12 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100