一直在尝试查看此处有关弹出的 DatePickers 的其他问题,EditText
但我在使其正常工作时遇到了问题。
我已经看到了可以使用setOnClickListener
或的示例setOnTouchListener
,哪一个是最好的?
我也看到了几个不同的设计DatePicker
,你如何改变设计?
下面是我到目前为止的代码,尝试使用其他示例中的代码,但无法正常工作。
import android.app.Activity;
import android.os.Bundle;
import android.widget.EditText;
import android.widget.TextView;
/**
* Created by MOS182 on 7/21/13.
*/
public class AddReminder extends Activity {
TextView Title, Amount, PaymentDate, ReminderDate, ReminderTime;
EditText eTitle, eAmount, ePaymentDate, eReminderDate, eReminderTime;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.reminders_dialog);
initializeVariables();
}
private void initializeVariables()
{
Title = (TextView) findViewById(R.id.tvTitle);
Amount = (TextView) findViewById(R.id.tvAmount);
PaymentDate = (TextView) findViewById(R.id.tvPaymentDate);
ReminderDate = (TextView) findViewById(R.id.tvReminderDate);
ReminderTime = (TextView) findViewById(R.id.tvReminderTime);
eTitle = (EditText) findViewById(R.id.etTitle);
eAmount = (EditText) findViewById(R.id.etAmount);
ePaymentDate = (EditText) findViewById(R.id.etPaymentDate);
eReminderDate = (EditText) findViewById(R.id.etReminderDate);
eReminderTime = (EditText) findViewById(R.id.etReminderTime);
}
}