java - Display datepickers value in a textview -
i developing android application... in there datepicker date of birth selected... when date displayed... example date january 0 displayed instead of 1 , february 1 displayed instead of 2.. , need value of date in 3 textviews... example if date 04/02/1984 ... need take 04 1 textview , 2 , 1984 one.... pls help..
@override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); final datepicker date = (datepicker) findviewbyid(r.id.datepicker1); final textview tvdate = (textview) findviewbyid(r.id.textview2); date.init(date.getyear(), date.getmonth(), date.getdayofmonth(),new ondatechangedlistener() { @override public void ondatechanged(datepicker arg0,int arg1, int arg2, int arg3) { // todo auto-generated method stub string date=integer.tostring(arg1); string month=integer.tostring(arg2); string year=integer.tostring(arg3); tvdate.settext(date + month + year); } } ); } }
you have create 3 textview , set date, month , year individually.
Comments
Post a Comment