Click here to Skip to main content
15,880,469 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My application needed two spinners appearing vertically parellel like a datepicker with date and month. I was trying to access the datepicker class object spinner, hide the year column and access the two columns. Can anyone help me on this.Thanks in advance.

What I have tried:

Field f[] = dp.getClass().getDeclaredFields();
//Field f[] = dp.getClass().getDeclaredField("mYearPicker");

for (Field field : f) {
Toast.makeText(getApplicationContext(), field.getName(), Toast.LENGTH_SHORT).show();

if (field.getName().equals("mYearPicker") || field.getName().equals("mYearSpinner")) {
field.setAccessible(true);
((View) field.get(this)).setVisibility(View.GONE);
}
}

Even this didnt work hiding the year column
Posted
Comments
David Crow 12-Jun-17 9:01am    
Is this of any help:

https://stackoverflow.com/questions/10233760/remove-year-from-datepickerdialog

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900