我有编辑框我想,当点击它来显示TimePickerDialog代替键盘,而当选择时间选取器消失,时间在EditText上显示TimePickerDialog
这个EditText上显示的适配器类这样
public class TminuseistAdaptar extends ArrayAdapter<Tr> {
private final Context context;
ArrayList<Tr> TrBasics ;
static final int TIME_DIALOG_ID = 0;
CheckBox Confirm ;
ImageButton DialUp;
EditText data ;
public TminuseistAdaptar(Context context, int ResourceId,
ArrayList<Tr> items)
{
super(context, ResourceId, items);
this.context = context;
this.TrBasics = items ;
}
public View getView(int position, View convertView, ViewGroup parent) {
}
}
我不喜欢的东西,对于EDITTEXT
textViewEncounterType = (EditText) rowView.findViewById(R.id.TminuseTime);
textViewEncounterType.setText(TreatementMinuseObject.TBasic.TreatementTime);
textViewEncounterType.setTag(position);
textViewEncounterType.setClickable(true);
textViewEncounterType.setInputType(InputType.TYPE_NULL);
textViewEncounterType.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
new TimePickerDialog(context, mTimeSetListener, hour, minute, false);
}
});
,但没有出现,我把这个适配器类在其他类扩展Fragement
public class TminusList extends Fragment {
问候
看一看这里http://stackoverflow.com/questions/8383550/timepicker-dialog – vasart 2012-07-08 13:41:01
看看这些链接http://www.mkyong.com/android/android -time-picker-example /,http://androidexam.blogspot.in/2011/09/android-time-picker-dialog-example.html,http://thesarmad.blogspot.in/2009/12/time- picker-example-android.html – Deepak 2012-07-08 13:43:28
如果我在适配器中,我的意思是类继承ArrayAdapter –
AMH
2012-07-08 14:26:20