Running into an issue with Datepicker – not sure if I misunderstanding how it should be used. In the graphic layout editor I added a Datepicker and I added that layout to my activity. When I run the application the month and day show up fine but instead of a year I see a calendar and I’m not sure why. Any ideas?
click for screenshot of the issue
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<DatePicker
android:id="@+id/datePicker1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
public class BirthdayActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_birthday);
}
}
By default its shown. You can set it to false with this:
First line of docs :