Tag: xml

“Content has view with id attribute 'android.r.id.list' that is not a ListView Class.” when create a list view in a fragment

Here is the problem. I have a list view, and it looks fine in the building, but it broke the error. Content has view with id attribute ‘android.r.id.list’ that is not a ListView Class. I haven’t added the listview into the XML, something like :@android:list, the reason I didn’t do that is I could find […]

Android: Entire ListView changes color on focus, not just ListView child item

I am trying to apply a selector to a ListView to make it easy for those without touch screens to navigate my app. The thing is, by applying the selector to the ListView, it only seems to apply the background colors to the entire list, not the items inside of it. Any ideas? Here’s some […]

How does Android Studio validate XML for the preferences screen?

I have this in my XML file for my preferences screen, based on other SO answers: <PreferenceScreen android:title=”@string/preference_title” android:summary=”@string/preference_summary”> <intent android:action=”android.intent.action.VIEW” android:data=”mailto:”> <extra android:name=”android.intent.extra.SUBJECT” android:value=”@string/email_subject”/> <extra android:name=”android.intent.extra.TEXT” android:value=”@string/email_body”/> </intent> </PreferenceScreen> Android Studio is flagging the “extra” elements as “not allowed here.” I don’t really understand how it is validating the XML at all because there […]

How to Change Text Style in Preference Fragment

I have created Preference Screen with Text View.User can change Text view style like font,color,size in Preference screen.so it will displayed on Textview which i have created in Preference Screen.but its not working .If its preference Activity ,we can use setContentview,In fragments i don’t know how to pass the view.. public final class TestFragment2 extends […]

space between editText and softkeyboard

i have an activity with an editText field almost at the bottom. when i focus on that editText field the keyboard shows up and pushes my edittext field up. when it stops there is no space between editText and my softkeyboard. is it possible to add some margin? this is my code: <?xml version=”1.0″ encoding=”utf-8″?> […]

Android – DataBinding with Preference activity

I set up the data binding in xml but when i go to the preference activity to actually set up the binding i cant. The file where the data binding xml is in is called preference.xml so i assume there should be a generated class called PreferencesBinding but instead there is not. Should it not […]

Can I preview the Action Bar in the graphical layout editor?

I’ve noticed that all of the ApiDemos construct the Action Bar programmatically at runtime. I’d love to be able to see the Action Bar with icons and even tabs from within the graphical layout editor. Is it possible to preview the Action Bar in the layout editor, or is it necessary to build the Action […]

Android – Unknown attribute style on a fragment tag

Can someone please explain to me why I am getting this warning in Android Studio 1.1.0: Unknown attribute style Full warning: The inspection highlights unknown XML attributes in Android resource files and AndroidManifest.xml Here is the code snippet: <fragment android:id=”@+id/frag_logo” tools:layout=”@layout/fragment_logo” style=”@style/FragmentLogo”/> The warning occurs on the style attribute. I am using gradle and android […]

How to retrieve parts of Wikipedia content into Android App?

Basically, I want to retrieve content from wikipedia. But I want to display it inside my Android Apps directly. Not immidiately redirect to the internet browser, but to display it inside my apps first. Currently, I manage to request the Wikipedia API and get only the main content by using http://en.wikipedia.org/w/api.php?action=parse&prop=text&format=xml&page=Bla_Bla_Bla. and because I parse […]

How to avoid Eclipse leaks on XServer when editing Android XML files?

When I’m editing XML files in Eclipse (mainly, Android layouts and so), it causes leaks on XServer and it ends eating all my RAM (4GB), so I have to Ctrl+Alt+Backspace to continue. Do you know any remedy for that?

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