0
我正在佈局上顯示佈局底部的結構。我需要在雙擊後顯示,然後在5秒後隱藏它。所以我使用這個倒數計時器:在android的countdowntimer錯誤?
public void timer()
{
cdt=new CountDownTimer(5000,1000) {
@Override
public void onTick(long millisUntilFinished) {
System.out.println("Timer Working"+millisUntilFinished+"");
}
@Override
public void onFinish() {
System.out.println("Finished");
main =(LinearLayout)findViewById(R.id.parent);
ViewGroup.MarginLayoutParams mlp = (ViewGroup.MarginLayoutParams)main.getLayoutParams();
mlp.height=420;
set_up_views();
find_module();
tl.setVisibility(View.INVISIBLE);
}
}.start();
}
但我不知道如何停止並重新啓動此計時器。我能怎麼做?
但是,這也保持運行沒有任何突破!我怎麼能停止並重新啓動? – Navdroid 2012-03-20 14:02:30
請參閱我的編輯說明 – 2012-03-20 14:21:38