Tag: xml

How to setup a main menu layout in Android?

For the app that I’m making, I plan on having a main menu composed of 6 different icons, with 2 per line. This is very similar to the Twitter main menu layout seen here: So basically… how should I go about setting up the XML? LinearLayout, TableLayout? And then, what do I actually do to […]

Android Studio not identifying xml file as layout file

I accidentally created drawer_list_item.xml in the screenshot using New -> File menu, instead of New -> Layout resource file and now I can’t open it as a regular layout file in design mode. It opens it as a plain text file. Is there any way I can change its type. I couldn’t find anything related […]

Android Lollipop Material Design Overflow Menu Icon color

I try the new Material Design on a Nexus 7 and have the following strange behaviour. The Overflow Menu Icon has a different color on the first app launch. I changed the android:textColorPrimary color and read this tutorial. First App launch: Second App launch: As you see the color of the primary text color is […]

AppCompat DayNight theme not work on Android 6.0?

I am using the new Theme.AppCompat.DayNight added in Android Support Library 23.2 On Android 5.1 it works well. On Android 6.0, activity looks like using light theme, but dialog looks using dark theme. My Application class: public class MyApplication extends Application { static { AppCompatDelegate.setDefaultNightMode( AppCompatDelegate.MODE_NIGHT_YES); } } My styles.xml <style name=”AppTheme” parent=”Theme.AppCompat.DayNight”> <item name=”colorPrimary”>@color/colorPrimary</item> […]

allow users to create forms within android survey/data collection app

I’m trying to develop an Android app that could be used by advocacy groups or campaigners such that they would be able to create their own forms (surveys) for which they can go out canvassing and collect opinion data from people who don’t have Internet connections and thus can’t take surveys/polls online. Could also be […]

Android InstrumentationTestRunner XML output for Hudson ingestion

I have an Android test project that I’d like to link into Hudson, but I haven’t found a way to output the test results as XML instead of text. Does anyone know if there’s an easy way to do this already? -Dan

android java onClick Could not execute method of the activity

This is my first time working with the recyclerview and I am getting some errors about android:onClick=”addItem” here is what I get when I try to add a line of text to my recyclerview. I usually use my phone to test my apps. java.lang.IllegalStateException: Could not execute method of the activity at android.view.View$1.onClick(View.java:4012) at android.view.View.performClick(View.java:4761) […]

Why I can't define android attributes in default namespace?

Typically I have to write layout code like this: <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:orientation=”vertical” /> I want to do something like this: <LinearLayout xmlns=”http://schemas.android.com/apk/res/android” layout_width=”fill_parent” layout_height=”fill_parent” orientation=”vertical” > But this code doesn’t run properly. Why? And second question: Why element namen are in CamelCase and attributes are in under_score?

Android Studio AndroidManifest.xml vs build.gradle

If anyone could help me understand some things regarding Android Studio, it would be most enlightening. So, I have switched from Eclipse to Android Studio around a month ago and so far have only been working on my migrated Apps. As such, I have been tinkering around with only the AndroidManifest.xml file as was customary […]

Best way to parse the Bible in Android

I am creating an Android app that needs to access the Bible. I want it to be offline, so I prefer not to use one of the internet APIs. After reading this this post, I decided to store the text locally as XML, like this <bible> <b n=”Genesis”> <c n=”1″> <v n=”1″>In the beginning, God […]

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