猿问

EditText获取焦点。

@Override

public void onClick(View v) {

// TODO Auto-generated method stub

switch (v.getId()) {

case R.id.tvGetAgain:

if (tvGetAgain.getText().toString().replace("", "").equals("再次获取")) {

mc.start();

}

break;

default:

break;

}

private class MyCount extends CountDownTimer {


public MyCount(long millisInFuture, long countDownInterval) {

super(millisInFuture, countDownInterval);

// TODO Auto-generated constructor stub

}


@Override

public void onTick(long millisUntilFinished) {

// TODO Auto-generated method stub

tvGetAgain.setText(millisUntilFinished / 1000 + "秒后\n重新获取");

tvGetAgain.setTextColor(getResources().getColor(R.color.text_gray));

}


@Override

public void onFinish() {

// TODO Auto-generated method stub

tvGetAgain.setText("再次获取");

tvGetAgain.setTextColor(getResources()

.getColor(R.color.text_green1));

}


}


QianWin
浏览 1463回答 1
1回答

子木李

诶~是分享还是提问还是笔记 :(
随时随地看视频慕课网APP

相关分类

Java
Android
我要回答