0

I'm trying to change style ErrorText and Date Picker but I think, I'm going to wrong way.

When I add ErrorText or Date Picker I see like this,

enter image description here

enter image description here

But I want to see like this,

enter image description here

enter image description here

Probably I'm select wrong theme in Android but I can't understand how can I fix it..

What can I do for change style ?

Emre Ozdemir
  • 122
  • 12
  • solved solution http://stackoverflow.com/questions/14933330/datepicker-how-to-popup-datepicker-when-click-on-edittext – Zia Aug 19 '14 at 06:54

2 Answers2

0

for date picker you can do this in u r java file

myCalendar = Calendar.getInstance();
     departDateCal=(ImageView)findViewById(R.id.departDateCalender);
        final DatePickerDialog.OnDateSetListener date = new DatePickerDialog.OnDateSetListener() {

            @Override
            public void onDateSet(DatePicker view, int year, int monthOfYear,
                    int dayOfMonth) {
                // TODO Auto-generated method stub
                 myCalendar.set(Calendar.YEAR, year);
                    myCalendar.set(Calendar.MONTH, monthOfYear);
                    myCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);
                    updateLabel(val);

            }

        };
        departDateCal.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    // TODO Auto-generated method stub
                    new DatePickerDialog(SearchFlight.this, date, myCalendar
                            .get(Calendar.YEAR), myCalendar.get(Calendar.MONTH),
                            myCalendar.get(Calendar.DAY_OF_MONTH)).show();

                }
            });

In the xml file

<ImageView
                    android:id="@+id/departDateCalender"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="5dp"
                    android:src="@drawable/calendar" />
  • Thanks your help but I'm probably have theme problem, when I change my Manifest.xml like above Datepicker solved but ErrorText still looking bad. – Emre Ozdemir Jul 22 '13 at 10:40
  • will u please explain u r problem once more I am confused what exactly u want –  Jul 22 '13 at 10:53
  • Actully I'm adding setError to Edittext and it's looks first image. Like this, http://i.stack.imgur.com/6unyj.png But I want to see like this, http://i.stack.imgur.com/D1Uth.png Can I understand ? Sorry my poor English :/ – Emre Ozdemir Jul 22 '13 at 11:03
  • 2
    @EmreOzdemir this is the solution of u r problem so through with it I hope it will definitely work for u http://stackoverflow.com/questions/15277683/datapicker-looks-like-old-design-on-new-apis-as-well –  Jul 22 '13 at 11:26
0

I'm sorry I solve half of the problem :)

When I change my Manifest.xml

android:theme="@android:style/Theme.Holo.Light.NoActionBar"

DataPicker looks like this but ErrorText still looks first state..

enter image description here

Emre Ozdemir
  • 122
  • 12