Tag: xml

Android / Eclipse / Premature end of xml file

Let me start by acknowledging that I did find a similar question on here but there was only one answer and that answer did not apply in my situation, so… I am just now wading into Android and have come upon a sticking point. I am using Eclipse and have run into a problem trying […]

Supported devices is extremely low

I have an app that should be supported on a huge number of devices, and yet when I upload it to Google Play, it says only 3 (out of 2263) are supported. My manifest looks like this (minus Activities): <manifest xmlns:android=”http://schemas.android.com/apk/res/android” package=”MYPACKAGE” android:versionCode=”101″ android:versionName=”@string/app_version” > <uses-sdk android:minSdkVersion=”8″ android:targetSdkVersion=”15″ /> <uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE” /> <uses-permission android:name=”android.permission.ACCESS_NETWORK_STATE” /> […]

Android. Change the background color of a FrameLayout from code

I’m trying to change the background color of a FramyLayout. The color is changing, but to the wrong one. However it is working fine if I do it through the XML. Here is my res/values/colors.xml code <?xml version=”1.0″ encoding=”utf-8″?> <resources> <color name=”grey”>#888888</color> <color name=”white”>#FFFFFF</color> <color name=”red”>#ffff3448</color> <color name=”green”>#ff408c3a</color> </resources> Here is how it looks like […]

RecyclerView Multiple Layout View(s) in an Adapter class

Here is what I have achieved ? 3 different sections, 10 different items in each section. Here is the tutorial link I am following and below is the Screenshot: Trying to show different Views for each and every Section. Like: For Section 1 (layout_1.xml) For Section 2 (layout_2.xml) For Section 3 (layout_3.xml) But showing layout […]

SwipeRefreshLayout can host only one direct child

I added a “pull to refresh” to my listView, i also wanted to add an empty view when the list is empty – Now i got this error. How can i make this work? if im positioning a view outside of the swipeRefresh and then add it as the emptyView it will work. So how […]

android image button tooltip

I’m trying to build an app with image buttons that work like the action bar but i can’t get them to show a tooltip on long press. <ImageButton android:id=”@+id/editUrgent” style=”?android:attr/borderlessButtonStyle” android:layout_width=”48dp” android:layout_height=”wrap_content” android:layout_centerVertical=”true” android:layout_toLeftOf=”@+id/editImportant” android:hint=”@string/hint_urgent” android:contentDescription=”@string/hint_urgent” android:text=”@string/hint_urgent” android:src=”@drawable/clock_light” /> android:contentDescription works for hovering(s-pen) but long press still does nothing.

How to retrieve value of an attribute which contains colon in the attribute name using xpath

I have a simple requirement where in I need to fetch the value of attribute xml:id i.e af1. I am making use of a SAXParser and here is my xpath:a/aff/@xml:id on the contrary I was able to fetch value of using the xpath:a/aff/@value. But i was unable to retrieve the value could you please help […]

Change ImageView

I have set up an ImageView in main.xml, if I want to access it from my View class and make it visible = false, how can I do this programatically? Thank you public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); theView = new GameView(this); theView.setBackgroundResource(R.layout.main); setContentView(theView);

Google Analytics w/ Android: Programmatically set ga_reportUncaughtExceptions?

tl;dr Is there a way to programatically enable reportUncaughtExceptions for Google Analytics (v4) without using the xml config in Android? Longer explanation I’m using Google Analytics v4 in an Android app, and I need a way to set two different tracking ids by build flavor. I was using a general global_tracker.xml configuration (see below), though […]

Error adding custom theme to app

I added the following theme to my app with a background color of white.But I get the following error and I’m not sure where I have gone wrong. Error: Color types not allowed (at ‘android:windowBackground’ with value ‘#FF0000’). <style name=”MyTheme” parent=”@android:style/Theme.Light”> <item name=”android:windowBackground”>#FF0000</item> </style> And referenced the theme in mymanifest: <activity android:name=”.MyActivity” android:theme=”@style/MyTheme” /> Any […]

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