I am using w2davids calendar and in that calendar, the author of the code has used an image (ImageView) to display the weekdays:
<LinearLayout
android:layout_gravity="center"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/calendarheader"
android:src="@drawable/blue_bg_with_text"
android:layout_gravity="center"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</ImageView>
</LinearLayout>

I would not like to use an image for the weekdays. How can I set it programmatically?
Create a horizontal
LinearLayoutwith sevenTextViews. You can set their contents usingDateUtils.getDayOfWeekString(). (I’m not sure if thatDateUtilsmethod is locale-compliant; if it’s not, try this method.)In terms of formatting, using a center
gravityon eachTextViewand a large upper padding on theLinearLayoutshould work fine, and you can set the background to whatever you need using a drawable.