void saveSnapshot(final SnapshotMetadata snapshotMetadata) {
AsyncTask<Void, Void, Snapshots.OpenSnapshotResult> task =
new AsyncTask<Void, Void, Snapshots.OpenSnapshotResult>() {
@Override
protected Snapshots.OpenSnapshotResult doInBackground(Void... params) {
if (snapshotMetadata == null) {
Log.i(TAG, "Calling open with " + currentSaveName);
return Games.Snapshots.open(mGoogleApiClient, currentSaveName, true)
.await();
}
else {
Log.i(TAG, "Calling open with " + snapshotMetadata);
return Games.Snapshots.open(mGoogleApiClient, snapshotMetadata)
.await();
}
}
@Override
protected void onPostExecute(Snapshots.OpenSnapshotResult result) {
Snapshot toWrite = processSnapshotOpenResult(RC_SAVE_SNAPSHOT, result, 0);
if (toWrite != null) {
Log.i(TAG, writeSnapshot(toWrite));
}
else {
Log.e(TAG, "Error opening snapshot: " + result.toString());
}
}
};
task.execute();
}
An AsyncTask object is being created I understand. I see from docs parameters can be changed or defined as needed. I could use more explanation on exactly why the first two parameters would be declared as Void, Void. As well doInBackground params type is a Void...? Is there significance to the use of "..." for instance what might be the difference between plain "Void" and "Void...".
I look forward to any responses or comments. The code I am taking from the CollectAllTheStars Google Play Games Services Basic Samples.
Thank you.