i am using the below XML file in this XML file when i click on Edittext the keypad is overlapping the edit text
XML:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#drawable/blue_bg"
>
<!-- Menu Panel -->
<RelativeLayout
android:id="#+id/menuPanel"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:gravity="right"
android:background="#52555a"
android:orientation="vertical" >
<TextView
android:id="#+id/menu_title_1"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_alignParentTop="true"
android:layout_marginLeft="0dp"
android:paddingLeft="15dp"
android:gravity="center_vertical"
android:background="#353535"
android:textColor="#android:color/white"
android:text="#string/menu_title">
</TextView>
<View
android:id="#+id/menu_item_divider_1"
android:layout_width="fill_parent"
android:layout_height="0.5dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_below="#+id/menu_title_1"
android:background="#b5b5b5"/>
<ListView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/menu_item_divider_1"
android:dividerHeight="1dp"
android:id="#+id/list"
></ListView>
</RelativeLayout>
<!-- Sliding Panel -->
<LinearLayout
android:id="#+id/slidingPanel"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/background"
android:gravity="left"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/header"
android:layout_width="match_parent"
android:layout_height="30dp"
android:background="#drawable/file" >
<View
android:id="#+id/header_vertical_divider_1"
android:layout_width="2dp"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_marginLeft="15dp"
android:layout_toRightOf="#+id/menuViewButton"
android:background="#drawable/engraved_bg" />
<ImageView
android:id="#+id/menuViewButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="15dp"
android:clickable="true"
android:contentDescription="#string/description"
android:onClick="slidewindow"
android:src="#drawable/icon_menu"
android:visibility="visible" />
<ImageView
android:id="#+id/logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:src="#drawable/sislogo"
/>
</RelativeLayout>
<View
android:id="#+id/dividerHeaderBottom"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#414141" />
<ImageView
android:id="#+id/clientlogo"
android:layout_width="match_parent"
android:layout_height="50dp"
android:scaleType="fitXY" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/rounded_edittext"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:paddingBottom="15dp"
android:layout_marginTop="15dp"
android:layout_weight="25"
>
<EditText
android:id="#+id/newuser"
style="#style/edittxt1"
android:layout_below="#+id/olduser"
android:layout_centerHorizontal="true"
android:visibility="invisible"
>
<requestFocus />
</EditText>
<EditText
android:id="#+id/confirmuser"
style="#style/edittxt1"
android:layout_below="#+id/newuser"
android:layout_centerHorizontal="true"
android:visibility="invisible"
>
<requestFocus />
</EditText>
<Button
android:id="#+id/changedetails"
style="#style/btnstyle"
android:layout_below="#+id/confirmuser"
android:layout_centerHorizontal="true"
android:background="#drawable/button_sytle"
android:onClick="usernamepassword"
android:text="Enter"
android:visibility="visible"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:layout_marginTop="20dp"
/>
<Spinner
android:id="#+id/manageaccounts"
style="#style/spinnerstyle"
android:layout_below="#+id/imageView1"
/>
<EditText
android:id="#+id/olduser"
style="#style/edittxt1"
android:layout_below="#+id/manageaccounts"
android:layout_centerHorizontal="true"
android:visibility="invisible"
>
<requestFocus />
</EditText>
<ListView
android:id="#+id/linkedparents"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/manageaccounts"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:visibility="invisible"
>
</ListView>
<ImageView
android:id="#+id/imageView1"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="#drawable/containerheader"></ImageView>
<TextView
android:id="#+id/textView1"
style="#style/mainlbl"
android:layout_alignBottom="#+id/imageView1"
android:layout_alignLeft="#+id/manageaccounts"
android:text="Manage Account(s)"
android:layout_marginBottom="5dp"
/>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
android:gravity="bottom">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="30dp"
android:gravity="bottom"
android:background="#drawable/bottom_bar">
<ImageView
android:id="#+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginBottom="3dp"
android:layout_marginLeft="10dp"
android:src="#drawable/hom"
android:onClick="HOME"
/>
<ImageView
android:id="#+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/imageView3"
android:layout_marginRight="5dp"
android:layout_marginBottom="3dp"
android:src="#drawable/logout"
android:onClick="Logout"
/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</FrameLayout>
i am using the requesfocous for each edittext i want edittext to move up when i click on edittext box how can i achieve this.
Set this property for the activity in your manifest
android:windowSoftInputMode="stateVisible|adjustPan"
If works please share it
Related
I have these 2 images for Land and Portrait mode orientation (Image 1 for Landscape mode, Image 2 for portrait mode, when I write when in Landscape mode and turn the orientation to portrait it does show the full writing i made in Landscape, therefore I want to make it scrollable when the orientation switches to portrait so it can show the full writing i made while it was in Landscape mode.
sorry i don't have up to 10reputations to post the image here directly:-
image 1: http://testimage/1.png
image 2: http://testimage/2.png
Below is the code I use when the orientation is in landscape,FYI: I also created a Layout-Land when in Landsacpe mode
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/rl"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/color12" >
<LinearLayout
android:id="#+id/menus"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<include layout="#layout/menu_layout" />
</LinearLayout>
<RelativeLayout
android:id="#+id/rl_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/menu_layout"
android:layout_below="#+id/menus" >
<FrameLayout
android:id="#+id/layouts"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="#+id/iv_note"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY" />
</FrameLayout>
<FrameLayout
android:id="#+id/layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" >
<ImageView
android:id="#+id/iv_notes"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:visibility="gone" />
</FrameLayout>
<LinearLayout
android:id="#+id/top_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal" >
<TextView
android:id="#+id/lblDate"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:textColor="#222222"
android:textSize="#dimen/title" />
<TextView
android:id="#+id/lblTime"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:textSize="#dimen/title"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:id="#+id/lblTotal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:textColor="#222222"
android:textSize="#dimen/title" />
</LinearLayout>
</LinearLayout>
<EditText
android:id="#+id/content"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/top_layout"
android:layout_marginBottom="5dp"
android:background="#null"
android:inputType="textMultiLine"
android:textSize="#dimen/title_size" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/bottom_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/menu_layout"
android:orientation="horizontal" >
<RelativeLayout
android:id="#+id/attach_view"
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:visibility="gone" >
<TextView
android:id="#+id/attachment_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="#+id/aImage"
android:ellipsize="start"
android:padding="2dp"
android:singleLine="true"
android:text="Attachment"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#222222" />
<ImageButton
android:id="#+id/aImage"
android:layout_width="60dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="3dp"
android:background="#drawable/bottom_bar"
android:padding="10dp"
android:src="#drawable/ic_email_attachment" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/bot_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/attach_view"
android:orientation="horizontal" >
<ImageView
android:id="#+id/lblRight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:padding="10dp"
android:src="#drawable/tool_left"
android:visibility="gone" />
<ImageView
android:id="#+id/lblLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:padding="10dp"
android:src="#drawable/tool_right"
android:visibility="gone" />
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:id="#+id/menu_layout"
android:layout_width="fill_parent"
android:layout_height="30dp"
android:layout_alignParentBottom="true"
android:background="#ffffff"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_gravity="right"
android:layout_weight="1"
android:orientation="horizontal" >
<include
android:id="#+id/tool_text_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
layout="#layout/tool_text_button_layout"
android:padding="13dp" />
<!--
<ImageView
android:id="#+id/menu_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:contentDescription="#string/content_desc"
android:padding="13dp"
android:src="#drawable/tool_type_text" />
-->
<ImageView
android:id="#+id/menu_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:contentDescription="#string/content_desc"
android:padding="5dp"
android:src="#drawable/tool_thumbs" />
<ImageView
android:id="#+id/menu_sync"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:contentDescription="#string/content_desc"
android:padding="5dp"
android:src="#drawable/sync"
android:visibility="visible" />
<ImageView
android:id="#+id/menu_attachment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:contentDescription="#string/content_desc"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:src="#drawable/ic_email_attachment_small"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_gravity="right"
android:layout_weight="1"
android:orientation="horizontal" >
<ImageView
android:id="#+id/menu_bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight=".20"
android:contentDescription="#string/content_desc"
android:paddingBottom="5dp"
android:paddingTop="7dp"
android:src="#drawable/ic_bold"
android:visibility="gone" />
<ImageView
android:id="#+id/menu_italics"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight=".20"
android:contentDescription="#string/content_desc"
android:paddingBottom="5dp"
android:paddingTop="7dp"
android:src="#drawable/ic_italics"
android:visibility="gone" />
<ImageView
android:id="#+id/menu_underline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight=".20"
android:contentDescription="#string/content_desc"
android:paddingBottom="5dp"
android:paddingTop="7dp"
android:src="#drawable/ic_underline"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
<ListView
android:id="#+id/list_mode"
android:layout_width="130dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/menus"
android:background="#android:color/background_dark"
android:divider="#ffffff"
android:dividerHeight="1dp"
android:visibility="gone" >
</ListView>
<LinearLayout
android:id="#+id/attach_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#android:color/background_light"
android:orientation="vertical"
android:visibility="gone" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal" >
<Button
android:id="#+id/Image"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_weight="1"
android:background="#drawable/bottom_bar"
android:text="Add Image"
android:textColor="#222222" />
<Button
android:id="#+id/Audio"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_weight="1"
android:background="#drawable/bottom_bar"
android:text="Add Audio"
android:textColor="#222222" />
<Button
android:id="#+id/Video"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_weight="1"
android:background="#drawable/bottom_bar"
android:text="Add Video"
android:textColor="#222222" />
</LinearLayout>
<ListView
android:id="#+id/mList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal" >
<Button
android:id="#+id/btn_save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_weight="1"
android:background="#drawable/bottom_bar"
android:gravity="center"
android:text="Save"
android:textColor="#222222"
android:visibility="gone"
android:width="100dp" />
<Button
android:id="#+id/btncancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_weight="1"
android:background="#drawable/bottom_bar"
android:gravity="center"
android:text="Exit"
android:textColor="#222222"
android:visibility="visible"
android:width="100dp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
This is the selection in the xml that has the yellow writing background
<FrameLayout
android:id="#+id/layouts"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="#+id/iv_note"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY" />
</FrameLayout>
As far as I know, Relative Layout has no orientation
LINK : http://developer.android.com/reference/android/widget/RelativeLayout.html
However you can make a scrollable view
How to implement HorizontalScrollView like Gallery?
Please I have a RelativeLayout and I have a section in my Layout I would like to make scrollable, this selection below. Please kindly answer using my full code. thank you.
<FrameLayout
android:id="#+id/layouts"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="#+id/iv_note"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY" />
</FrameLayout>
This is the full code below:-
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/rl"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/color12" >
<LinearLayout
android:id="#+id/menus"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<include layout="#layout/menu_layout" />
</LinearLayout>
<RelativeLayout
android:id="#+id/rl_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/menu_layout"
android:layout_below="#+id/menus" >
<FrameLayout
android:id="#+id/layouts"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="#+id/iv_note"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY" />
</FrameLayout>
<FrameLayout
android:id="#+id/layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" >
<ImageView
android:id="#+id/iv_notes"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:visibility="gone" />
</FrameLayout>
<LinearLayout
android:id="#+id/top_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal" >
<TextView
android:id="#+id/lblDate"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:textColor="#222222"
android:textSize="#dimen/title" />
<TextView
android:id="#+id/lblTime"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:textSize="#dimen/title"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:id="#+id/lblTotal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:textColor="#222222"
android:textSize="#dimen/title" />
</LinearLayout>
</LinearLayout>
<EditText
android:id="#+id/content"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/top_layout"
android:layout_marginBottom="5dp"
android:background="#null"
android:inputType="textMultiLine"
android:textSize="#dimen/title_size" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/bottom_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/menu_layout"
android:orientation="horizontal" >
<RelativeLayout
android:id="#+id/attach_view"
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:visibility="gone" >
<TextView
android:id="#+id/attachment_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="#+id/aImage"
android:ellipsize="start"
android:padding="2dp"
android:singleLine="true"
android:text="Attachment"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#222222" />
<ImageButton
android:id="#+id/aImage"
android:layout_width="60dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="3dp"
android:background="#drawable/bottom_bar"
android:padding="10dp"
android:src="#drawable/ic_email_attachment" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/bot_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/attach_view"
android:orientation="horizontal" >
<ImageView
android:id="#+id/lblRight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:padding="10dp"
android:src="#drawable/tool_left"
android:visibility="gone" />
<ImageView
android:id="#+id/lblLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:padding="10dp"
android:src="#drawable/tool_right"
android:visibility="gone" />
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:id="#+id/menu_layout"
android:layout_width="fill_parent"
android:layout_height="30dp"
android:layout_alignParentBottom="true"
android:background="#ffffff"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_gravity="right"
android:layout_weight="1"
android:orientation="horizontal" >
<include
android:id="#+id/tool_text_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
layout="#layout/tool_text_button_layout"
android:padding="13dp" />
<!--
<ImageView
android:id="#+id/menu_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:contentDescription="#string/content_desc"
android:padding="13dp"
android:src="#drawable/tool_type_text" />
-->
<ImageView
android:id="#+id/menu_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:contentDescription="#string/content_desc"
android:padding="5dp"
android:src="#drawable/tool_thumbs" />
<ImageView
android:id="#+id/menu_sync"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:contentDescription="#string/content_desc"
android:padding="5dp"
android:src="#drawable/sync"
android:visibility="visible" />
<ImageView
android:id="#+id/menu_attachment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:contentDescription="#string/content_desc"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:src="#drawable/ic_email_attachment_small"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_gravity="right"
android:layout_weight="1"
android:orientation="horizontal" >
<ImageView
android:id="#+id/menu_bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight=".20"
android:contentDescription="#string/content_desc"
android:paddingBottom="5dp"
android:paddingTop="7dp"
android:src="#drawable/ic_bold"
android:visibility="gone" />
<ImageView
android:id="#+id/menu_italics"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight=".20"
android:contentDescription="#string/content_desc"
android:paddingBottom="5dp"
android:paddingTop="7dp"
android:src="#drawable/ic_italics"
android:visibility="gone" />
<ImageView
android:id="#+id/menu_underline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight=".20"
android:contentDescription="#string/content_desc"
android:paddingBottom="5dp"
android:paddingTop="7dp"
android:src="#drawable/ic_underline"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
<ListView
android:id="#+id/list_mode"
android:layout_width="130dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/menus"
android:background="#android:color/background_dark"
android:divider="#ffffff"
android:dividerHeight="1dp"
android:visibility="gone" >
</ListView>
<LinearLayout
android:id="#+id/attach_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#android:color/background_light"
android:orientation="vertical"
android:visibility="gone" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal" >
<Button
android:id="#+id/Image"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_weight="1"
android:background="#drawable/bottom_bar"
android:text="Add Image"
android:textColor="#222222" />
<Button
android:id="#+id/Audio"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_weight="1"
android:background="#drawable/bottom_bar"
android:text="Add Audio"
android:textColor="#222222" />
<Button
android:id="#+id/Video"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_weight="1"
android:background="#drawable/bottom_bar"
android:text="Add Video"
android:textColor="#222222" />
</LinearLayout>
<ListView
android:id="#+id/mList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal" >
<Button
android:id="#+id/btn_save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_weight="1"
android:background="#drawable/bottom_bar"
android:gravity="center"
android:text="Save"
android:textColor="#222222"
android:visibility="gone"
android:width="100dp" />
<Button
android:id="#+id/btncancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_weight="1"
android:background="#drawable/bottom_bar"
android:gravity="center"
android:text="Exit"
android:textColor="#222222"
android:visibility="visible"
android:width="100dp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
You need to put some layout (linear/relative) in the scrollView in place you needed and inside this layout put your frameLayout
Just put a <ScrollView> around the elements you want to be scrolled. If I understood you right, this is this fragment:
<FrameLayout
android:id="#+id/layouts"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="#+id/iv_note"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY" />
</FrameLayout>
This should solve your problem :
<ScrollView
android:layout_width="match_parent"
android:layout_height="20dp"
android:id="#+id/scrollView">
<FrameLayout
android:id="#+id/layouts"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="#+id/iv_note"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY" />
</FrameLayout>
</ScrollView>
I have included a common layout inside of FragmentActivity.I want to fire onclick event of common layout ToggleButton, inside of fragment class.How can I achieve this?
ToggleButton tbMainLocation = (ToggleButton) getView().findViewById(
R.id.tbMainLocation);
but tbMainLocation always return nullpointerexception
commonlayout:
layout_include.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<RelativeLayout
android:id="#+id/rlMainLivTopBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/cyan"
android:paddingBottom="10dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" >
<TextView
android:id="#+id/txtMainBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="<"
android:textColor="#color/white"
android:textSize="30sp"
android:visibility="gone" />
<ImageView
android:id="#+id/imgMainBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:background="#drawable/back"
android:visibility="gone" />
<AutoCompleteTextView
android:id="#+id/actv_edt_search_tag_feed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginLeft="5dp"
android:background="#drawable/round_corner_edittext"
android:ems="10"
android:hint="Search by tag"
android:singleLine="true"
android:text=""
android:textSize="15dp"
android:visibility="gone" >
<requestFocus />
</AutoCompleteTextView>
<TextView
android:id="#+id/txtMainTagneme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_centerVertical="true"
android:text=""
android:textColor="#color/white"
android:visibility="gone" />
<TextView
android:id="#+id/txtMainExpertName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_centerVertical="true"
android:text=""
android:textColor="#color/white"
android:visibility="gone" />
<!--
<ImageView
android:id="#+id/img_notification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
androImid:background="#drawable/notification" />
-->
<ImageView
android:id="#+id/imgMainExpertEarnByFlight"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:background="#drawable/plane_normal"
android:visibility="gone" />
<!--
<ImageView
android:id="#+id/imgMainLocation"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginRight="5dp"
android:layout_centerVertical="true"
android:layout_toLeftOf="#+id/imgMainSearch"
android:background="#drawable/location"
android:visibility="visible" />
-->
<ToggleButton
android:id="#+id/tbMainLocation"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:background="#drawable/location_selector"
android:focusable="false"
android:focusableInTouchMode="false"
android:textOff=""
android:textOn="" />
</RelativeLayout>
<LinearLayout
android:id="#+id/llExpertfragmentChooseDistance"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/rl_liv_top_bar"
android:background="#color/light_cyan"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:visibility="gone" >
<TextView
android:id="#+id/txt_choose_distance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|center"
android:layout_marginRight="2dp"
android:maxWidth="60dp"
android:paddingLeft="10dp"
android:text="#string/choose_distance"
android:textSize="10dp" />
<ImageView
android:id="#+id/img_expert_earn_by_walk"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/walk_normal" />
<TextView
android:id="#+id/txt_cycle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|center"
android:layout_marginLeft="-2dp"
android:layout_marginRight="-2dp"
android:background="#color/cyan_line"
android:maxHeight="6dp"
android:minWidth="40dp" />
<ImageView
android:id="#+id/img_expert_earn_by_cycle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/cycle_normal" />
<TextView
android:id="#+id/txt_bike"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|center"
android:layout_marginLeft="-2dp"
android:layout_marginRight="-2dp"
android:background="#color/cyan_line"
android:maxHeight="6dp"
android:minWidth="40dp" />
<ImageView
android:id="#+id/img_expert_earn_by_bike"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/car_normal" />
<TextView
android:id="#+id/txt_train"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|center"
android:layout_marginLeft="-2dp"
android:layout_marginRight="-2dp"
android:background="#color/cyan_line"
android:maxHeight="6dp"
android:minWidth="40dp" />
<ImageView
android:id="#+id/img_expert_earn_by_flight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/plane_normal" />
</LinearLayout>
</RelativeLayout>
fragmentactivity.xml
<com.liv.slidingmenu.layout.MainLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<!-- This holds our menu -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/ll_top_menu_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#6d6d6d"
android:orientation="vertical" >
<!-- This acts as Actionbar -->
<LinearLayout
android:id="#+id/ll_prof_img"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
android:background="#434242" >
<RelativeLayout
android:id="#+id/rr_img_detail"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="#+id/img_prof"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerVertical="true"
android:layout_gravity="center"
android:layout_marginLeft="25dp"
android:layout_marginTop="20dp"
android:background="#drawable/profile_image" />
<TextView
android:id="#+id/txt_expt_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/img_leve"
android:layout_marginLeft="35dp"
android:layout_marginTop="35dp"
android:layout_toRightOf="#+id/img_prof"
android:text=""
android:textColor="#ffffff" />
<TextView
android:id="#+id/txt_level"
android:layout_width="70dp"
android:layout_height="30dp"
android:layout_below="#+id/txt_expt_name"
android:layout_marginLeft="35dp"
android:layout_marginTop="10dp"
android:layout_toRightOf="#+id/img_prof"
android:background="#drawable/level_background"
android:gravity="center_horizontal"
android:paddingTop="5dp"
android:text=""
android:textColor="#d2d2d2" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/ll_prof_item"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.6" >
<ListView
android:id="#+id/listview_menu_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="#292929"
android:dividerHeight="0.1dip" >
</ListView>
</LinearLayout>
</LinearLayout>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="#+id/ll_topbar"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<include
android:id="#+id/topbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
layout="#layout/layout_include" />
</RelativeLayout>
<TabHost
android:id="#android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_below="#+id/ll_topbar" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="-3dp"
android:orientation="vertical" >
<FrameLayout
android:id="#android:id/tabcontent"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="0" />
<FrameLayout
android:id="#+android:id/realtabcontents"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
<!-- android:id="#android:id/tabs" -->
<TabWidget
android:id="#android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#f9f9f9"
android:orientation="horizontal" />
</LinearLayout>
</TabHost>
</RelativeLayout>
</com.liv.slidingmenu.layout.MainLayout>
To access views that belong to the activity layout you can use
getActivity().findViewById(R.id.viewid);
Make sure the fragment is attached to the activity and getActivity() does not return null.
Quoting docs
The fragment can access the Activity instance with getActivity() and
easily perform tasks such as find a view in the activity layout
http://developer.android.com/guide/components/fragments.html
First of all sorry for my english, This is my first question on StackOverflow, but I've learned a lot here .
Now I have a problem, which I couldn't solve. I have a framelayout with some elements. In android 4.x, Menu Panel's buttons onClick method doesn't fire. menupanel work to be in scroolview but in android 2.x buttons and layout work without problem as i want. I didn't find a problem.
Thanks for the help!
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<!-- Menu Panel starts here -->
<RelativeLayout
android:scrollbars="none"
android:id="#+id/menuPanel"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="#drawable/gray_bg"
android:gravity="right"
android:orientation="vertical">
<TextView
android:id="#+id/menu_title_1"
android:layout_width="fill_parent"
android:layout_height="45dp"
android:layout_alignParentTop="true"
android:layout_marginLeft="0dp"
android:background="#353535"
android:gravity="center_vertical"
android:paddingLeft="15dp"
android:text="#string/menu_title"
android:textColor="#android:color/white"
android:textSize="20sp"
android:textStyle="bold" >
</TextView>
<View
android:id="#+id/menu_item_divider_5"
android:layout_width="fill_parent"
android:layout_height="0.5dp"
android:layout_below="#+id/menu_title_1"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#b5b5b5" />
<Button
android:id="#+id/aktifgorevlerim"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_below="#+id/menu_item_divider_5"
android:background="#drawable/buton"
android:gravity="center_vertical"
android:onClick="AYARLAR_Click"
android:paddingLeft="15dp"
android:text="#string/item_1"
android:textColor="#android:color/white" >
</Button>
<View
android:id="#+id/menu_item_divider_2"
android:layout_width="fill_parent"
android:layout_height="0.5dp"
android:layout_below="#+id/aktifgorevlerim"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#b5b5b5" />
<Button
android:id="#+id/tamamlanmisgorevlerim"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_below="#+id/menu_item_divider_2"
android:background="#drawable/buton"
android:gravity="center_vertical"
android:onClick="GOREVLERIM_Click"
android:paddingLeft="15dp"
android:text="#string/item_2"
android:textColor="#android:color/white" />
<View
android:id="#+id/menu_item_divider_1"
android:layout_width="fill_parent"
android:layout_height="0.5dp"
android:layout_below="#+id/tamamlanmisgorevlerim"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:background="#b5b5b5" />
<Button
android:id="#+id/hakkinda"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_below="#+id/menu_item_divider_1"
android:background="#drawable/buton"
android:gravity="center_vertical"
android:onClick="HAKKINDA_Click"
android:paddingLeft="15dp"
android:text="HAKKINDA"
android:textColor="#android:color/white" >
</Button>
<Button
android:id="#+id/cikisyap"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_marginLeft="0dp"
android:background="#drawable/buton2"
android:gravity="center_vertical"
android:onClick="CIKISYAP_Click"
android:paddingLeft="15dp"
android:text="#string/item_4"
android:textColor="#android:color/white" >
</Button>
</RelativeLayout>
<!-- menuPanel ends here -->
<ScrollView
android:id="#+id/scrolpanel"
android:layout_width="wrap_content"
android:fillViewport="false"
android:layout_height="fill_parent"
>
<LinearLayout
android:id="#+id/slidingPanel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#android:color/white"
android:gravity="left"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/header"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginBottom="5dp"
android:background="#drawable/blue_bg" >
<View
android:id="#+id/header_vertical_divider_1"
android:layout_width="2dp"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_marginLeft="15dp"
android:layout_toRightOf="#+id/menuViewButton"
android:background="#drawable/engraved_bg" />
<ImageView
android:id="#+id/menuViewButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="15dp"
android:clickable="true"
android:contentDescription="#string/description"
android:src="#drawable/icon_menu"
android:visibility="visible" />
<TextView
android:id="#+id/titlebar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="Talep Detay Formu"
android:textColor="#color/White"
android:textSize="20sp" />
</RelativeLayout>
<EditText
android:id="#+id/Textgorevbaslik"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:ems="10"
android:gravity="top"
android:hint="Görev Başlığı"
android:textSize="10pt" >
<requestFocus />
</EditText>
<EditText
android:id="#+id/Textgorevaciklama"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:gravity="top"
android:hint="Açıklama"
android:lines="6"
android:singleLine="false"
android:textSize="10pt" >
</EditText>
<CheckBox
android:id="#+id/Checkgrupgorevi"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:gravity="center"
android:onClick="CHECKBOX_click"
android:text="Grup Görevi mi ?" >
</CheckBox>
<Spinner
android:id="#+id/spinnergorevkisilistesi"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:gravity="center" />
<Spinner
android:id="#+id/spinnergorevprojelistesi"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:gravity="center" />
<Spinner
android:id="#+id/spinnergorevdurumlistesi"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:gravity="center" />
<CheckBox
android:id="#+id/Checkgorulmegorevi"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:gravity="center"
android:text="Sadece Yönetici ve Uzman Görebilsin ?" >
</CheckBox>
<Spinner
android:id="#+id/spinnergorevonceliksirasi"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:gravity="center" />
<Button
android:id="#+id/btngorevekle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:background="#drawable/roundedbutton"
android:height="35dp"
android:onClick="GOREVEKLE"
android:text="EKLE"
android:textColor="#color/White"
android:textStyle="bold"
android:width="100dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:height="100dp"/>
</LinearLayout>
</ScrollView>
</FrameLayout>
onClick method
public void GOREVLERIM_Click(View view){
Intent intent = new Intent(GorevEkleActivity.this, GorevActivity.class);
startActivity(intent);
}
Thanks for answers. I found the solution. I put scrollview in a linearlayout. Problem was solved.
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<ScrollView
android:id="#+id/scrolpanel"
android:layout_width="match_parent"
android:fillViewport="false"
android:layout_height="match_parent"
android:orientation="vertical"
>
.
.
.
</ScrollView>
</LinearLayout>
When you click EditView (textStandardSMS) custom dialog box with EditView appears where you can enter text. But when I click on EditView in the dialogue, the keyboard is showing and then starts some error.
Everything is fine when I pulled "textStandardSMS" to the "main" layout window.
Here layout that causes the errors:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/startLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/tlo_m"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/startLayout2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="right" >
<ImageView
android:id="#+id/imageONOFF"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:src="#drawable/power_1" />
<ImageView
android:id="#+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:onClick="fHelp"
android:src="#drawable/ic_menu_info_details" />
<ImageView
android:id="#+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:onClick="fHistory"
android:src="#drawable/ic_menu_send" />
<ImageView
android:id="#+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:onClick="fTempleteSMS"
android:src="#drawable/ic_menu_compose" />
</LinearLayout>
<LinearLayout
android:id="#+id/startLayout3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp" >
<LinearLayout
android:id="#+id/startLayout4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<CheckBox
android:id="#+id/cbStandardSMS"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="#drawable/bucik_cb_1"
android:button="#android:color/transparent" />
<ImageView
android:id="#+id/bEditStandardSMS"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:clickable="true"
android:onClick="fGetTemplateStandard"
android:src="#drawable/add_template" />
</LinearLayout>
<TextView
android:id="#+id/textStandardSMS"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#drawable/ramka5"
android:clickable="true"
android:onClick="fEditStandardSMS"
android:text="#string/empty"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<LinearLayout
android:id="#+id/startLayout5"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="horizontal" >
<LinearLayout
android:id="#+id/startLayout6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<CheckBox
android:id="#+id/cBOutSMS"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="#drawable/bucik_cb_1"
android:button="#android:color/transparent" />
<ImageView
android:id="#+id/bEditOut"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:clickable="true"
android:onClick="fGetTemplateOut"
android:src="#drawable/add_template" />
</LinearLayout>
<TextView
android:id="#+id/TextOut"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#drawable/ramka5"
android:clickable="true"
android:onClick="fEditOutSMS"
android:text="#string/empty"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<LinearLayout
android:id="#+id/startLayout7"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="13dp"
android:text="#string/MessagesList"
android:textSize="25sp"
android:textStyle="bold" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="fAddProfil"
android:src="#drawable/ic_menu_add" />
</LinearLayout>
<ListView
android:id="#+id/listView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="10dp"
android:layout_marginTop="15dp"
android:cacheColorHint="#android:color/transparent"
android:clickable="true" >
</ListView>
</LinearLayout>
And here is the one that no causes the errors:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/startLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/tlo_m"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/startLayout2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="right" >
<ImageView
android:id="#+id/imageONOFF"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:src="#drawable/power_1" />
<ImageView
android:id="#+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:onClick="fHelp"
android:src="#drawable/ic_menu_info_details" />
<ImageView
android:id="#+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:onClick="fHistory"
android:src="#drawable/ic_menu_send" />
<ImageView
android:id="#+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:onClick="fTempleteSMS"
android:src="#drawable/ic_menu_compose" />
</LinearLayout>
<LinearLayout
android:id="#+id/startLayout3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp" >
<LinearLayout
android:id="#+id/startLayout4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<CheckBox
android:id="#+id/cbStandardSMS"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="#drawable/bucik_cb_1"
android:button="#android:color/transparent" />
<ImageView
android:id="#+id/bEditStandardSMS"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:clickable="true"
android:onClick="fGetTemplateStandard"
android:src="#drawable/add_template" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="#+id/textStandardSMS"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#drawable/ramka5"
android:clickable="true"
android:onClick="fEditStandardSMS"
android:text="#string/empty"
android:textAppearance="?android:attr/textAppearanceSmall" />
<LinearLayout
android:id="#+id/startLayout5"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="horizontal" >
<LinearLayout
android:id="#+id/startLayout6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<CheckBox
android:id="#+id/cBOutSMS"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="#drawable/bucik_cb_1"
android:button="#android:color/transparent" />
<ImageView
android:id="#+id/bEditOut"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:clickable="true"
android:onClick="fGetTemplateOut"
android:src="#drawable/add_template" />
</LinearLayout>
<TextView
android:id="#+id/TextOut"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#drawable/ramka5"
android:clickable="true"
android:onClick="fEditOutSMS"
android:text="#string/empty"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<LinearLayout
android:id="#+id/startLayout7"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="13dp"
android:text="#string/MessagesList"
android:textSize="25sp"
android:textStyle="bold" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="fAddProfil"
android:src="#drawable/ic_menu_add" />
</LinearLayout>
<ListView
android:id="#+id/listView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="10dp"
android:layout_marginTop="15dp"
android:cacheColorHint="#android:color/transparent"
android:clickable="true" >
</ListView>
</LinearLayout>
Could anyone tell me, why this is happening?