forked from upstream-mirrors/OpenTracks
Add custom error message when trying to make a track public in Google Drive
This commit is contained in:
@@ -674,6 +674,13 @@ limitations under the License.
|
||||
%2$s service url. E.g, maps.google.com.">
|
||||
An error has occurred. Unable to export to %1$s (%2$s). Please try again.
|
||||
</string>
|
||||
<string name="export_google_error_public"
|
||||
translation_description="The error message when not able to make a track public.
|
||||
|
||||
%1$s service name. E.g, Google Drive.
|
||||
%2$s service url. E.g, drive.google.com.">
|
||||
Unable to make track public in %1$s (%2$s).
|
||||
</string>
|
||||
<string name="export_google_fusion_tables"
|
||||
translation_description="When exporting a track, the option to export to Google Fusion Tables.">
|
||||
Google Fusion Tables
|
||||
|
||||
+11
-3
@@ -97,9 +97,17 @@ public class UploadResultActivity extends FragmentActivity implements ChooseActi
|
||||
success = sendRequest.isSpreadsheetsSuccess();
|
||||
}
|
||||
|
||||
String message = getString(
|
||||
success ? R.string.export_google_success : R.string.export_google_error,
|
||||
getString(serviceName), getString(serviceUrl));
|
||||
int messageId;
|
||||
if (success) {
|
||||
messageId = R.string.export_google_success;
|
||||
} else {
|
||||
if (sendRequest.isDriveSharePublic()) {
|
||||
messageId = R.string.export_google_error_public;
|
||||
} else {
|
||||
messageId = R.string.export_google_error;
|
||||
}
|
||||
}
|
||||
String message = getString(messageId, getString(serviceName), getString(serviceUrl));
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this).setCancelable(true)
|
||||
.setIcon(success ? R.drawable.ic_dialog_success : android.R.drawable.ic_dialog_alert)
|
||||
.setMessage(message)
|
||||
|
||||
Reference in New Issue
Block a user