我有編輯框我想,當點擊它來顯示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