Tag: android

android layout: This tag and its children can be replaced by one <TextView/> and a compound drawable

When I run layout on a specific XML file, I get this: This tag and its children can be replaced by one <TextView/> and a compound drawable What change should be done for the following xml code: <LinearLayout android:id=”@+id/name_layout” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:gravity=”center_vertical” android:background=”@drawable/grouplist_single_left_grey_area” > <ImageView android:id=”@+id/photo_image” android:layout_width=”@dimen/thumbnail_width” android:layout_height=”@dimen/thumbnail_height” android:paddingBottom=”5dip” android:paddingTop=”5dip” android:paddingRight=”5dip” android:paddingLeft=”5dip” android:layout_marginRight=”5dip” android:clickable=”true” android:focusable=”true” […]

Android Studio/Intellij Idea: “Table of Contents” for a class

I have been messing around with Android Studio and so far I like most of what I have seen. One thing that has been annoying me though is this lack of “Table of Contents” for a class. I apologize for not knowing exactly what to call it. But what I am referring to is the […]

PreferenceFragmentCompat requires preferenceTheme to be set

With the new PreferenceFragmentCompat from the v7 Preference Support Library: http://developer.android.com/tools/support-library/features.html#v7-preference, I get this error E java.lang.IllegalStateException: Must specify preferenceTheme in theme E at android.support.v7.preference.PreferenceFragmentCompat.onCreate(PreferenceFragmentCompat.java:202) What theme should be set? Update: I have tried using <item name=”preferenceTheme”>@style/PreferenceThemeOverlay</item> as suggested by @Bogato but it doesn’t look right and looks very Holo even on Lollipop. Support library: […]

Error “can't use subversion command line client : svn” when opening android project checked out from svn

I’m new to Android development and the development tools around it. I have checked out a project from svn using TortoiseSVN client (can’t manage to do it from within Android Studio), then get this error message after importing the project to Android Studio: can’t use subversion command line client : svn Probably the path to […]

In Android, how to make space between LinearLayout children?

I am programatically adding custom views to a vertical LinearLayout, and I would like there to be some space between the views. I have tried adding: setPadding(0, 1, 0, 1) to my CustomView constructor, but this doesn’t seem to have any effect. Any advice? *It was pointed out that I should use margins. Since I […]

How to add icon inside EditText view in Android ?

I want to add a “search” icon to appear inside an EditText in the left edge? such as search box in Facebook Android app?

No repository found error in Installing ADT in eclipse Indigo

This error comes when I try to install ADT: An error occurred while collecting items to be installed session context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=). No repository found containing: osgi.bundle,com.android.ide.eclipse.adt,16.0.1.v201112150204-238534 No repository found containing: org.eclipse.update.feature,com.android.ide.eclipse.adt,16.0.1.v201112150204-238534 No repository found containing: osgi.bundle,com.android.ide.eclipse.ddms,16.0.1.v201112150204-238534 No repository found containing: org.eclipse.update.feature,com.android.ide.eclipse.ddms,16.0.1.v201112150204-238534 No repository found containing: osgi.bundle,com.android.ide.eclipse.hierarchyviewer,16.0.1.v201112150204-238534 No repository found containing: org.eclipse.update.feature,com.android.ide.eclipse.hierarchyviewer,16.0.1.v201112150204-238534 No […]

ExpandableListView – hide indicator for groups with no children

In an ExpandableListView, is there a way to hide the group indicator for groups with no children?

How do you turn off version control in android studio?

I set up my Github with android studio, everything worked fine, the problem now is though, that I can’t seem to turn off, or get out of version control to use the IDE normally again. This means that errors aren’t shown, and it is really hard to debug because of this. So how do I […]

Return a value from AsyncTask in Android

This question already has an answer here: How to get the result of OnPostExecute() to main activity because AsyncTask is a separate class? 13 answers

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