Click here to Skip to main content
15,665,276 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")) {
((View) field.get(this)).setVisibility(View.GONE);

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

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