forked from upstream-mirrors/OpenTracks
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.">
|
found.">
|
||||||
No account found
|
No account found
|
||||||
</string>
|
</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"
|
<string name="send_google_no_service_selected"
|
||||||
translation_description="When sending a track to Google, a message indicating that the user has
|
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.">
|
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.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@@ -177,7 +178,7 @@ public class AccountChooserActivity extends Activity {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void onFailure() {
|
public void onFailure() {
|
||||||
finish();
|
handleNoAccountPermission();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -188,7 +189,7 @@ public class AccountChooserActivity extends Activity {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void onFailure() {
|
public void onFailure() {
|
||||||
finish();
|
handleNoAccountPermission();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -199,7 +200,7 @@ public class AccountChooserActivity extends Activity {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void onFailure() {
|
public void onFailure() {
|
||||||
finish();
|
handleNoAccountPermission();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -211,7 +212,7 @@ public class AccountChooserActivity extends Activity {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void onFailure() {
|
public void onFailure() {
|
||||||
finish();
|
handleNoAccountPermission();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -283,4 +284,12 @@ public class AccountChooserActivity extends Activity {
|
|||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
finish();
|
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