Tag: xml

Border color on Android button

I have a button created and have set the background color and text color as can be seen below. My question is: how do I set the buttons border color? I want to set the border color to white Here is the button in my res -> layout -> main_nav.xml <Button android:id=”@+id/btn_emergency” style=”@style/buttonStyle” android:layout_width=”fill_parent” android:layout_height=”wrap_content” […]

How to create RadioButton group in preference.xml window?

I’m beginner in Java Android developing. I’m using Eclipse SDK 3.6.1 version. I have a preferences window with two checkbox and one back button. <?xml version=”1.0″ encoding=”utf-8″?> <PreferenceScreen xmlns:android=”http://schemas.android.com/apk/res/android”> <PreferenceCategory android:title=”PIN requirement”> <CheckBoxPreference android:title=”Use PIN” android:defaultValue=”true” android:key=”checkboxPref” /> <CheckBoxPreference android:title=”Don’t use PIN” android:defaultValue=”false” android:key=”checkboxPref2″ /> </PreferenceCategory> <PreferenceCategory> <Preference android:title=”Back” android:key=”customPref” /> </PreferenceCategory> </PreferenceScreen> How to […]

How to apply two different styles to one element in android?

I have a TextView and I want to apply a Style which I use for all TextView elements plus another style which I only use within a specific Activity. Is there any possibility to do that?

Problems understanding Android XML layout_weight

I really tried to, but I can’t understand how Android interprets layout_weight setting… What I’m trying to achieve is a header on top with a fixed height an input area at the bottom containing an EditText and a Button a content part in the middle that’s taking all what’s left of space When typing I’d […]

android.view.inflateexception binary xml file line #1 error inflating class android.widget.relativeLayout

Hello guys i am new in android. I just made a new layout with one text bar and 2 buttons but it didn’t work, I am posting the stack trace and my relative layout file any idea about this? I saw the same question there which says to decrease the draw able size. But it […]

attribute is missing the android namespace prefix

Im creating an android app which uses a menu.xml file in the res folder. But I’m getting the above error. What does it mean? How can I fix it? menu.xml: <?xml version=”1.0″ encoding= “utf-8″?> <menu xmlns:android=”http://schemas.android.com/apk/res/android”> <item id=”@+id/my_location” android:icon=”@drawable/my_location” android:title:=”Current location” /> <item id=”@+id/mapview_satellite” android:icon=”@drawable/satelliteview” android:title=”Satellite View” /> <item id=”@+id/mapview_normal” android:icon=”@drawable/normalview” android:title=”Normal view” /> </menu>

A required meta-data tag in your app's AndroidManifest.xml does not exist.

I am developing a google maps app for android. But, somehow my application crashes giving an error like : java.lang.IllegalStateException: A required meta-data tag in your app’s AndroidManifest.xml does not exist. This is what my AndroidManifest.xml looks like:- <?xml version=”1.0″ encoding=”utf-8″?> <manifest xmlns:android=”http://schemas.android.com/apk/res/android” package=”com.example.locations” android:versionCode=”1″ android:versionName=”1.0″ > <uses-sdk android:minSdkVersion=”8″ android:targetSdkVersion=”18″ /> <uses-permission android:name=”android.permission.INTERNET”/> <uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE”/> […]

How to set height and width of compound drawable texview in xml?

I can’t see any tag to set width Here I set textview height, if I set width it will not work properly. <TextView android:id=”@+id/nome” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:textColor=”#FFFFFF” android:drawableLeft=”@drawable/ic_launcher” android:height=”50dp” /> How can I set this in xml? Is it possible?

How to add documentation to custom attributes?

I know how to create custom attributes for views, for example: <?xml version=”1.0″ encoding=”utf-8″?> <resources> <declare-styleable name=”SomeViewsCustomAttrs”> <attr name=”someAttr” format=”dimension” /> <attr name=”anotherAttr” format=”boolean” /> </declare-styleable> </resources> I am wondering if there is a way to add documentation to these custom attrs. While editing layouts in the XML editor, you can get tooltips that describe […]

Multiple animations on 1 imageview android

I have 2 animations which are already working, i want to fade my train + tween my train on the same time. If I execute 1 of these lines it works. But if I try to execute both it, only 1 will work.. I really can’t find a solution here. Maybe you can help? final […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.