|
@@ -60,6 +60,15 @@ public class ActivityRecorderActivity extends Activity {
|
60
|
60
|
}
|
61
|
61
|
};
|
62
|
62
|
|
|
63
|
+ private final Runnable startRunnable = new Runnable() {
|
|
64
|
+
|
|
65
|
+ public void run() {
|
|
66
|
+ startService(new Intent(ActivityRecorderActivity.this,
|
|
67
|
+ RecorderService.class));
|
|
68
|
+ updateRunnable.run();
|
|
69
|
+ }
|
|
70
|
+ };
|
|
71
|
+
|
63
|
72
|
private OnClickListener clickListener = new OnClickListener() {
|
64
|
73
|
|
65
|
74
|
public void onClick(View arg0) {
|
|
@@ -71,9 +80,9 @@ public class ActivityRecorderActivity extends Activity {
|
71
|
80
|
bindService(new Intent(ActivityRecorderActivity.this, RecorderService.class),
|
72
|
81
|
connection, BIND_AUTO_CREATE);
|
73
|
82
|
} else {
|
74
|
|
- startService(new Intent(ActivityRecorderActivity.this,
|
75
|
|
- RecorderService.class));
|
76
|
|
- handler.postDelayed(updateRunnable, 500);
|
|
83
|
+ handler.removeCallbacks(updateRunnable);
|
|
84
|
+ ((Button) findViewById(R.id.togglebutton)).setEnabled(false);
|
|
85
|
+ handler.postDelayed(startRunnable, 500);
|
77
|
86
|
}
|
78
|
87
|
} catch (RemoteException ex) {
|
79
|
88
|
Log.e(getClass().getName(), "Unable to get service state", ex);
|