android - can we get Reference of Date picker Dialog from DateSetListener? -



android - can we get Reference of Date picker Dialog from DateSetListener? -

is there way reference of date picker dialog date set listener in parameter has view of date set listener?

if(type.equalsignorecase("datepicker") { mfield=new edittext(context); ((edittext) mfield).settext("pick date"); ll.addview(mfield); mfield.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { final calendar cal = calendar.getinstance(); myear = cal.get(calendar.year); mmonth = cal.get(calendar.month); mday = cal.get(calendar.day_of_month); datepickerdialogwithedittext dialog= new datepickerdialogwithedittext(context, mdatepickerdialog , myear, mmonth, mday, (edittext)mfield ); dialog.show(); } }); } } private datepickerdialogwithedittext.ondatesetlistener mdatepickerdialog = new datepickerdialogwithedittext.ondatesetlistener() { public void ondateset(datepicker view , int year , int month, int date) { myear = year; mmonth = month; mday = date; edittext et = ((datepickerdialogwithedittext.ondatesetlistener)this).getassociatedtextview(); et.settext(new stringbuilder().append(mday).append("-").append(mmonth).append("-").append(myear)); } }; } class datepickerdialogwithedittext extends datepickerdialog { edittext tv; datepickerdialogwithedittext(context c, ondatesetlistener od, int y, int m, int d, edittext tv) { super(c, od, y, m, d); this.tv = tv; } edittext getassociatedtextview() { homecoming tv; } }

datepickerdialogwithedittext dialog= new datepickerdialogwithedittext(context, mdatepickerdialog , myear, mmonth, mday, (edittext)mfield );

instaed of above statement.. datepickerdialogwithedittext dialog variable class variable or instance variable visisble whole class.... mean this

class { private datepickerdialogwithedittext dialog; public method { dialog= new datepickerdialogwithedittext(context, mdatepickerdialog , myear, mmonth, mday, (edittext)mfield ); } }

android android-2.2-froyo

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -