Show an error message when not able to get account permission

when sending a track to google.
This commit is contained in:
Jimmy Shih
2012-06-22 12:05:28 -07:00
parent c8be5919fd
commit ec8e8acb27
2 changed files with 18 additions and 4 deletions
+5
View File
@@ -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.">
@@ -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();
}
}