我在按钮中得到字符串。文本我只想显示特定字符,但是当单击在 toast 中显示完整值时,我将如何做到这一点?
Button e01;
String[] days = new String[7];
e01.setText(days[1]); // 2013/09/11
//i want to display only 11
@Override
public void onClick (View v){
// TODO Auto-generated method stub
switch (v.getId()) {
case R.id.e01:
value = e01.getText().toString();
Toast.makeText(this, value, Toast.LENGTH_SHORT).show();
//value=// 2013/09/11
break;
}
}
calendarGlobal = Calendar.getInstance();
DateFormat df = new SimpleDateFormat("yyyy/MM/dd");
calendarGlobal.add(Calendar.WEEK_OF_YEAR, +currentweekno);
calendarGlobal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
String[] days = new String[7];
for (int i = 0; i < 7; i++) {
// days.add(df.format(calendarGlobal.getTime()));
Log.d("TAG",df.format(calendarGlobal.getTime()));
days[i] = df.format(calendarGlobal.getTime());
e01.setText(days[1]);
// ..