那就用个线程.
boolean isRuning=false;
Thread t=new Thread(){
public void run(){
while(true){
if(isRuning){
//里面是你要实现按按钮后的功能
}
try{
Thread.sleep(20);
}catch(Exception e){}
}
}
};
t.start();
这样只要你按一下按钮时改变isRuning这个boolean值就行了

那就用个线程.
boolean isRuning=false;
Thread t=new Thread(){
public void run(){
while(true){
if(isRuning){
//里面是你要实现按按钮后的功能
}
try{
Thread.sleep(20);
}catch(Exception e){}
}
}
};
t.start();
这样只要你按一下按钮时改变isRuning这个boolean值就行了