以下の SetupActivity のコード スニペットを見てください。ここで起動したタスクが実際に正しく実行されたことをテストするにはどうすればよいですか?
たとえば、この行:
new AttachChildGcmTask(app).execute(app.getChildInfo().getId());
私のアクティビティからのコードスニペット:
....
@Override
public void onClick(View v) {
if (v.getId() == R.id.btn_proceed) {
finishSetup();
}
}
private void finishSetup() {
UIUtilities.showToast(this, R.string.setup_completed, true);
final AppBipper app = (AppBipper) getApplication();
app.setSetupCompleted(true);
Log.i(TAG, "finishSetup childId: "+app.getChildInfo().getId());
new AttachChildGcmTask(app).execute(app.getChildInfo().getId());
Log.i(TAG, "download settings");
new FetchClientSettings(app).execute();
Log.i(TAG, "cancel all scheduled alarms");
ScheduledLocationsHelper helper =
ScheduledLocationsHelper.getInstance(app.getDBManager(), app);
helper.cancelAlarms();
startActivity(new Intent(this, StartupActivity.class));
finish();
}