Background ListView becomes black when scrolling

I have created a specific List which exists out of the following elements to create a scrollable list with every row containing a Image on the left side and some text on the right side: To begin with a “root” layout : <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:orientation=”vertical” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:background=”#C8C8C8″ > <TextView android:layout_width=”fill_parent” android:layout_height=”wrap_content”/> <ListView android:id=”@android:id/list” android:layout_width=”fill_parent” … Read more

How to stop EditText from gaining focus at Activity startup in Android

I have an Activity in Android, with two elements: EditText ListView When my Activity starts, the EditText immediately has input focus (flashing cursor). I don’t want any control to have input focus at startup. I tried: EditText.setSelected(false); EditText.setFocusable(false); No luck. How can I convince the EditText to not select itself when the Activity starts? 5 … Read more

Android ListView headers

Here’s how I do it, the keys are getItemViewType and getViewTypeCount in the Adapter class. getViewTypeCount returns how many types of items we have in the list, in this case we have a header item and an event item, so two. getItemViewType should return what type of View we have at the input position. Android will then take care of passing you the right type of View in convertView automatically. Here what … Read more