onLongClick
或onLongLouch
一个TextView
,我需要每60秒将其值增加1,如下所示:
<TextView
android:layout_width="match_parent"
android:text="00 min"
android:id="@+id/timer"
android:layout_height="120dp"
/>
答案 0 :(得分:0)
创建一个以毫秒为单位运行的计时器。
final Handler handlerIncrementar = new Handler();
Timer timerTexto = new Timer();
TimerTask tareaEjecucion = new TimerTask() {
@Override
public void run() {
handlerIncrementar.post(new Runnable() {
public void run() {
try {
yourtextview.setTextSize(yourtextview.getTextSize() + 1);
} catch (Exception e) {
}
}
});
}
};
timerTexto.schedule(tareaEjecucion, 0, 60000);