All texts in the app are gone after a while - android

This is probably the weirdest thing it ever happened to me. I inherit this code from another developer and I can't figure out which is the problem.
The app uses the sherlocknabvar and it also has a screen with a mapfragment where you can move a pin around and once the map is settled it calls several APIs to get some info about your position. The rest of the activities are pretty normal, nothing fancy about them. The map activity is quite complex though.
This is the error I have... weirdest thing is that it only happens sometimes, so it's not easy to reproduce it but I still can see it happen from time to time.
After playing with the map for a while (moving the pin, zooming in and out and so on) if I go back to the main activity (by clicking a home button on the navbar or by clicking the back button) all the texts in my app are gone in all the activities. I can see all the different layouts with images and colours but all the texts are completely gone. The only way to have them back is by restarting the app.
Looking at the Android Device Monitor (in case was some memory leak) everything looked pretty stable (28016K/33287K as max) and even worst, I can reproduce that error in an old Sony Xperia but also in a new brand S5.
EDIT
I found out that the texts where not missing, the color was changing to transparent for some reason that I still don't get. I disabled the hardware acceleration and it works but I'm still wondering what the problem could be and why that changed fixed it.
This is one of the layouts I'm having problems with, all the TextViews just change to transparent without any reason. It happens to the TextViews that have an 'static' text and also to the ones that I change the text dynamically.
<?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="match_parent"
android:fillViewport="true"
android:background="#drawable/new_bg_background_app"
>
<ScrollView
android:layout_alignParentTop="true"
android:layout_above="#+id/anc_button"
android:fadeScrollbars="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="#+id/anc_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="25dp"
android:gravity="center"
android:text="#string/lb_confirmed"
android:textColor="#color/orange"
android:textAppearance="#style/Font50PX"
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/ic_confirmed"
android:layout_marginTop="15dp"
android:src="#drawable/new_ic_active"
android:layout_below="#+id/anc_title"
android:layout_centerHorizontal="true" />
<TextView
android:id="#+id/lb_pick_up"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:gravity="center"
android:layout_below="#+id/ic_confirmed"
android:text="#string/lb_your_pick_up"
android:textAppearance="#style/Font28PX"
android:textColor="#color/text_gray" />
<TextView
android:id="#+id/txt_passengers"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_below="#+id/lb_pick_up"
android:text="5 Passengers"
android:textAppearance="#style/Font50PX"
android:textColor="#color/white"/>
<TextView
android:id="#+id/lb_from"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="6dp"
android:layout_below="#+id/txt_passengers"
android:text="#string/lb_from"
android:layout_marginTop="15dp"
android:textAppearance="#style/Font28PX"
android:gravity="center"
android:textColor="#color/text_gray" />
<TextView
android:id="#+id/txt_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="60"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:gravity="center"
android:layout_below="#+id/lb_from"
android:textAppearance="#style/Font50PX"
android:textColor="#color/white"
/>
<TextView
android:id="#+id/txt_post_code"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="60"
android:gravity="center"
android:layout_below="#+id/txt_address"
android:textAppearance="#style/Font45PX"
android:textColor="#color/text_gray"
/>
<TextView
android:id="#+id/lb_at"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/txt_post_code"
android:text="#string/lb_at"
android:layout_marginTop="15dp"
android:textAppearance="#style/Font28PX"
android:gravity="center"
android:textColor="#color/text_gray" />
<TextView
android:id="#+id/txt_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_below="#+id/lb_at"
android:textAppearance="#style/Font50PX"
android:text="9:00 AM Today"
android:textColor="#color/white"
/>
<TextView
android:id="#+id/txt_note"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/txt_time"
android:layout_marginTop="20dp"
android:gravity="center"
android:text="#string/lb_mini"
android:textAppearance="#style/Font26PX"
android:textColor="#color/text_gray"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/txt_note"
android:layout_marginTop="10dp"
android:gravity="center"
>
<TextView
android:id="#+id/lb_reference"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/lb_reference"
android:layout_marginTop="15dp"
android:textAppearance="#style/Font32PX"
android:textColor="#color/white"
/>
<TextView
android:id="#+id/txt_reference"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/lb_reference"
android:layout_marginLeft="4dp"
android:layout_marginTop="17dp"
android:textAppearance="#style/Font28PX"
android:textColor="#color/white"
/>
</RelativeLayout>
</RelativeLayout>
</ScrollView>
<Button
android:id="#+id/anc_button"
android:layout_width="fill_parent"
android:layout_height="60dp"
android:text="#string/lb_done"
android:background="#drawable/new_btn_orange"
android:layout_margin="5dp"
android:onClick="onDone"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"/>
</RelativeLayout>

This issue was fixed after disabling the hardware acceleration in the manifest just for the activity I was having the problem with
android:hardwareAccelerated="false"

Related

Why does this android app does not display in full view in smaller screen device?

I'm using Relative Layout and I set the width and length to match_parent. It displays fine in Redmi k30 but in Pixel XL it only display up-to Delete Record, it does not display View All Record and scrolling also does not work.
I'm new to android and just starting layout designs, please advice. Thank you!
It should display like this:
But on Pixel XL the last button is missing:
XML layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#2196F3"
android:padding="10dp"
tools:context=".RUDActivity">
<TextView
android:id="#+id/txtTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Please enter product ID to retrieve"
android:textColor="#37474F"
android:textSize="24dp" />
<EditText
android:id="#+id/prodId"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/txtTitle"
android:hint="Product ID"
android:textColor="#37474F"
android:inputType="number"
android:textSize="24dp" />
<EditText
android:id="#+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/prodId"
android:layout_marginTop="30dp"
android:hint="Name"
android:textColor="#37474F"
android:inputType="textPersonName"
android:textSize="24dp" />
<EditText
android:id="#+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/name"
android:hint="Description"
android:textColor="#37474F"
android:inputType="text"
android:textSize="24dp" />
<EditText
android:id="#+id/price"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/description"
android:hint="Price"
android:textColor="#37474F"
android:inputType="numberDecimal"
android:textSize="24dp" />
<EditText
android:id="#+id/quantity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/price"
android:hint="Quantity"
android:textColor="#37474F"
android:inputType="number"
android:textSize="24dp" />
<Button
android:id="#+id/btnSearch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/quantity"
android:layout_marginTop="30dp"
android:text="Search Data"
android:textSize="24dp" />
<Button
android:id="#+id/btnView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/btnDelete"
android:layout_marginTop="30dp"
android:text="View All Record"
android:textSize="24dp" />
<Button
android:id="#+id/btnUpdate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/btnSearch"
android:layout_marginTop="30dp"
android:text="Update Record"
android:textSize="24dp" />
<Button
android:id="#+id/btnDelete"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/btnUpdate"
android:layout_marginTop="30dp"
android:text="Delete Record"
android:textSize="24dp" />
Welcome to android..
Think of arranging 15 people in 5 rows of 3 in a dark room.
If you have to make them look the same whatever the dimensions of the room might be then the space cannot be the same.
Redmi and Pixel XL are high density and long devices.
You can use this library Intuit SDK library for the dimensions. This library helps to automatically scale depending on the screen size.
Going forward However you have to use ConstraintLayout with matchConstraints and come up with a design idea that makes it look the same in most devices.
For eg: Making the upper form 1 section and the lower buttons another.
And instead of following a top-down approach make the form part stick to the top and the buttons part to the bottom.
For the scroll you have to use a ScrollView and wrap your layouts within it , Here is a good Stackover FLow Question to get started

Make a ScrollView scroll to the bottom when the soft keyboard appears in Android?

So I am making a texting app just to mess around with the different things in android programming and have yet to run into a problem that I can't find the answer for online. I have tried several different answers from this site and other android programming forums and not one of them has worked every time. There are some examples that work every other time, whereas other examples will work only once. This is the only thing left in the app that I need to figure out for UI functionality.
I have an XML layout file as such:
<RelativeLayout
android:id="#+id/rlActionBar2"
android:layout_width="fill_parent"
android:layout_height="44dp" >
</RelativeLayout>
<RelativeLayout
android:id="#+id/rlAddContact"
android:layout_width="fill_parent"
android:layout_height="44dp"
android:layout_below="#+id/rlActionBar2"
android:background="#drawable/new_message_background"
android:padding="0dp" >
<TextView
android:id="#+id/tvTo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="8dp"
android:text="#string/text_to"
android:textColor="#7F7F7F"
android:textSize="17sp" />
<EditText
android:id="#+id/txtContact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#id/tvTo"
android:layout_marginLeft="6dp"
android:layout_toLeftOf="#+id/btnAddContact"
android:layout_toRightOf="#id/tvTo"
android:background="#00000000"
android:hint="#string/contact_name"
android:inputType="textPersonName"
android:maxLines="1"
android:textColor="#000000"
android:textSize="16sp" >
</EditText>
<Button
android:id="#+id/btnAddContact"
android:layout_width="28.5dp"
android:layout_height="28.5dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="3dp"
android:layout_marginRight="3dp"
android:background="#drawable/add_button"
android:padding="0dp" />
</RelativeLayout>
<ScrollView
android:id="#+id/svMessageView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="#+id/rlNewMessage"
android:layout_alignParentLeft="true"
android:layout_below="#id/rlAddContact"
android:background="#DBE2ED" >
<LinearLayout
android:id="#+id/llMessages"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#DBE2ED"
android:isScrollContainer="true"
android:orientation="vertical"
android:paddingTop="11dp" >
</LinearLayout>
</ScrollView>
<RelativeLayout
android:id="#+id/rlNewMessage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#drawable/messagebar_background"
android:gravity="bottom"
android:padding="0dp" >
<Button
android:id="#+id/btnAttatchment"
android:layout_width="26dp"
android:layout_height="26dp"
android:layout_alignBottom="#+id/txtMessageBox"
android:layout_marginLeft="6dp"
android:background="#drawable/camera_icon" />
<EditText
android:id="#+id/txtMessageBox"
android:layout_width="253dp"
android:layout_height="wrap_content"
android:layout_marginBottom="6dp"
android:layout_marginLeft="6dp"
android:layout_marginTop="8dp"
android:layout_toRightOf="#id/btnAttatchment"
android:background="#drawable/messagebox_background"
android:hint="#string/app_name"
android:inputType="textMultiLine"
android:maxLines="6"
android:minHeight="26dp"
android:textSize="17sp" >
</EditText>
<Button
android:id="#+id/btnSend"
android:layout_width="58dp"
android:layout_height="26dp"
android:layout_alignBottom="#id/txtMessageBox"
android:layout_alignParentRight="true"
android:layout_marginRight="6dp"
android:background="#drawable/send_button"
android:text="#string/send_button"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:textSize="14sp"
android:textStyle="bold" />
</RelativeLayout>
</RelativeLayout>
My problem is getting the ScrollView svMessageView to automatically scroll to the bottom every time the soft keyboard comes onto the screen for the user to type. The RelativeLayout rlNewMessage moves up when the keyboard appears, and the bottom of svMessageView is set to stick to the top of rlNewMessage and that works, but I can't get the svMessageView to scroll to the bottom by itself.
Images:
After soft keyboard loads (not what I want): http://imgur.com/8Kptge3
After soft keyboard loads (what I want): http://imgur.com/BcDcFPY
If more information is needed for you to figure out the problem let me know and I will post it asap.
I did not test it, but you may try scrollView.fullScroll(View.FOCUS_DOWN); on EditText touch listener perhaps.
Add this in your Manifest.xml for Activity and feed me back
android:windowSoftInputMode="adjustNothing"

Android Button text not centered when using API 17 for rendering

In the graphical view of layout, when I choose API 15 or lower from the button shown in the image below, the text in the encircled buttons looks fine.
When I choose API 17, the text is displaced even though the xml code is same. Changing the button padding does not help.
Is this just a problem with Eclipse or is it possible that new versions of android may see this displaced text?
What's the workaround to fix this?
XML code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".HomeActivity" >
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_margin="3dp" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:src="#drawable/label" />
</LinearLayout>
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/linearLayout1"
android:layout_below="#+id/linearLayout1"
android:layout_marginTop="20dp"
android:text="#string/about_title"
android:textSize="20sp" />
<TextView
android:id="#+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView1"
android:layout_alignRight="#+id/linearLayout1"
android:layout_below="#+id/textView1"
android:layout_marginTop="5dp"
android:text="#string/temp" />
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView2"
android:layout_alignRight="#+id/textView2"
android:layout_below="#+id/textView2"
android:layout_marginTop="20dp"
android:baselineAligned="false" >
<Button
android:id="#+id/button1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/news" />
<Button
android:id="#+id/button2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/tournaments" />
<Button
android:id="#+id/button3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/results" />
</LinearLayout>
android:gravity="center" did not help
I restarted eclipse twice. Strangely it did not help in the first restart but it looked fine after the second one. Also, its working fine on device.
Apologies for the question, I must have waited before posting the question.
Not sure if the default style for Buttons changed in API17... possibly...
Anyway, adding android:gravity="center" should be fixing this for you.
i don't know i faced this problem check restart a eclipse.. and check..
adding android:gravity="center" should be fixing this for you

Cannot completely fill the screen with RelativeLayout and cannot resize on Keyboard opening

So here is my XML. I am trying to fill the whole screen and when I view it in Eclipse, it fills the whole screen. However, when I open it on my phone, everything is smaller and there are views overlaying. I don't know what's going on.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TextView
android:id="#+id/front"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:text="Front"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/frontInput"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_below="#+id/front"
android:ems="10" >
<requestFocus />
</EditText>
<TextView
android:id="#+id/back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/frontInput"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:text="Back"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/backInput"
android:layout_width="fill_parent"
android:layout_height="200dp"
android:layout_alignParentLeft="true"
android:layout_below="#+id/back"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:ems="10"
android:inputType="textMultiLine" />
<TextView
android:id="#+id/background"
android:layout_width="wrap_content"
android:layout_marginLeft="5dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/backInput"
android:layout_marginTop="44dp"
android:text="Background"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/colors_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/backInput"
android:layout_marginLeft="30dp"
android:layout_marginTop="22dp"
android:layout_toRightOf="#+id/background"
/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/colors_spinner" >
<Button
android:id="#+id/save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Save" />
<Button
android:id="#+id/cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Cancel" />
</LinearLayout>
</RelativeLayout>
this is what it looks in Eclipse.
But I get this:
Another thing is that when I open the keyboard my view does not rezise so you can see everything but smaller so you can see what you are typing etc... I have added the android:windowSoftInputMode="adjustResize" for the specific activity but nothing is happening... Any ideas? Thanks guys...
If you use adjustResize it will resize everything to fit as best it can. The other option is adjustPan, which will scroll the window so that the focused EditText will be in the view and the caret visibile. Other than that there's no real way to control things.
In your case you have some exact heights in there, so it won't work well with a resize, since you can't shrink an exact height.
Also, never trust how things look in Eclipse. Its an attempt to lay things out that shares no code with how Android really does things, it should be viewed as an estimate. Real layouts may end up looking significantly different, especially for complex layouts.

Changing Buttons from Relative Layout to Linear Layout weird side-effects

The strangest thing happened to me today and caused hours of frustration and anger-management issues.
I had a working Android slideshow application. However, I was unhappy with the buttons (which were in a Relative Layout), and moved them to a Linear Layout. However, when running my application, the behavior of the buttons got swapped around (ie Button 1 did Button 2's work and vice-versa). I was able to remedy this by changing the id of ONE of the buttons, not all (that didn't work). Also related to this, was that my application started crashing when I switched orientation. It had worked previously when I had the Relative Layout. (I am using a Handler to change the UI for the slideshow)
I was unable to solve this issue, so I reverted to my Relative Layout, but I would like to know how this could have happened in the first place.
The layout that works:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_centerInParent="true"
android:contentDescription="#string/imageView"
android:scaleType="centerInside"
android:src="#drawable/image1" />
<TextView
android:id="#+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceMedium" />
<ImageButton
android:id="#+id/startStop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:contentDescription="#string/startStop"
android:src="#drawable/ic_menu_slideshow" />
<ImageButton
android:id="#+id/next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="false"
android:layout_toRightOf="#+id/startStop"
android:contentDescription="#string/next"
android:src="#drawable/ic_media_next" />
<ImageButton
android:id="#+id/previous"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="false"
android:layout_toLeftOf="#+id/startStop"
android:contentDescription="#string/previous"
android:src="#drawable/ic_media_previous" />
</RelativeLayout>
The code that causes problems:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_centerInParent="true"
android:contentDescription="#string/imageView"
android:scaleType="centerInside"
android:src="#drawable/image1" />
<TextView
android:id="#+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceMedium" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="#30eee9e9" >
<ImageButton
android:id="#+id/previous"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="#string/previous"
android:src="#drawable/ic_media_previous" />
<ImageButton
android:id="#+id/bla"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="#string/startStop"
android:src="#drawable/ic_menu_slideshow" />
<ImageButton
android:id="#+id/next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="#string/next"
android:src="#drawable/ic_media_next" />
I had the same problem but with Relative Layout as parent & Linear Layout as child layout I took four imagebuttons
PLAY
SCORE
HELP
QUIT
And buttons functionality was shifted to one below next i.e. when I pressed PLAY nothing happened when pressed SCORE Game started playing when clicked HELP showed me score and so on.. I put my whole night for solving the problem but nothing happened I shutted off dam thing tried to watch movie but for a while I was getting boared watching it I started Eclipse again and the magic that it was working so fine. Dont know But Rebuild & Clean has solved my problem as DeeV said

Categories

Resources