mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-02 09:33:06 +02:00
Show an error message when not able to get account permission
when sending a track to google.
This commit is contained in:
@@ -1359,6 +1359,11 @@ limitations under the License.
|
||||
found.">
|
||||
No account found
|
||||
</string>
|
||||
<string name="send_google_no_account_permission"
|
||||
translation_description="When sending to Google, the message when not able to get account
|
||||
permission.">
|
||||
Not able to get account permission. Make sure network is available.
|
||||
</string>
|
||||
<string name="send_google_no_service_selected"
|
||||
translation_description="When sending a track to Google, a message indicating that the user has
|
||||
not selected any Google service and no data is sent.">
|
||||
|
||||
+13
-4
@@ -41,6 +41,7 @@ import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -177,7 +178,7 @@ public class AccountChooserActivity extends Activity {
|
||||
}
|
||||
@Override
|
||||
public void onFailure() {
|
||||
finish();
|
||||
handleNoAccountPermission();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -188,7 +189,7 @@ public class AccountChooserActivity extends Activity {
|
||||
}
|
||||
@Override
|
||||
public void onFailure() {
|
||||
finish();
|
||||
handleNoAccountPermission();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -199,7 +200,7 @@ public class AccountChooserActivity extends Activity {
|
||||
}
|
||||
@Override
|
||||
public void onFailure() {
|
||||
finish();
|
||||
handleNoAccountPermission();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -211,7 +212,7 @@ public class AccountChooserActivity extends Activity {
|
||||
}
|
||||
@Override
|
||||
public void onFailure() {
|
||||
finish();
|
||||
handleNoAccountPermission();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -283,4 +284,12 @@ public class AccountChooserActivity extends Activity {
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles when not able to get account permission.
|
||||
*/
|
||||
private void handleNoAccountPermission() {
|
||||
Toast.makeText(this, R.string.send_google_no_account_permission, Toast.LENGTH_LONG).show();
|
||||
finish();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user