|
@@ -6,6 +6,7 @@
|
6
|
6
|
package uk.co.md87.android.activityrecorder;
|
7
|
7
|
|
8
|
8
|
import android.app.Activity;
|
|
9
|
+import android.app.ProgressDialog;
|
9
|
10
|
import android.content.ComponentName;
|
10
|
11
|
import android.content.Intent;
|
11
|
12
|
import android.content.ServiceConnection;
|
|
@@ -34,6 +35,7 @@ import uk.co.md87.android.common.ExceptionHandler;
|
34
|
35
|
public class ActivityRecorderActivity extends Activity {
|
35
|
36
|
|
36
|
37
|
ActivityRecorderBinder service = null;
|
|
38
|
+ ProgressDialog dialog;
|
37
|
39
|
|
38
|
40
|
final Handler handler = new Handler();
|
39
|
41
|
|
|
@@ -83,6 +85,10 @@ public class ActivityRecorderActivity extends Activity {
|
83
|
85
|
} else {
|
84
|
86
|
handler.removeCallbacks(updateRunnable);
|
85
|
87
|
((Button) findViewById(R.id.togglebutton)).setEnabled(false);
|
|
88
|
+
|
|
89
|
+ dialog = ProgressDialog.show(ActivityRecorderActivity.this, "Starting service",
|
|
90
|
+ "Please wait...", true);
|
|
91
|
+
|
86
|
92
|
handler.postDelayed(startRunnable, 500);
|
87
|
93
|
}
|
88
|
94
|
} catch (RemoteException ex) {
|
|
@@ -123,6 +129,11 @@ public class ActivityRecorderActivity extends Activity {
|
123
|
129
|
((Button) findViewById(R.id.togglebutton)).setText(service.isRunning()
|
124
|
130
|
? R.string.service_enabled : R.string.service_disabled);
|
125
|
131
|
((Button) findViewById(R.id.togglebutton)).setEnabled(true);
|
|
132
|
+
|
|
133
|
+ if (dialog != null) {
|
|
134
|
+ dialog.dismiss();
|
|
135
|
+ dialog = null;
|
|
136
|
+ }
|
126
|
137
|
|
127
|
138
|
final List<Classification> classifications = service.getClassifications();
|
128
|
139
|
final ArrayAdapter<Classification> adapter = (ArrayAdapter<Classification>)
|