我正在製作一個Android應用程序,用戶可以從中分享谷歌加我們的應用程序的意見。第一次,當我點擊共享按鈕時,它要求輸入用戶的用戶名和密碼,輸入共享後成功執行然後當我再次點擊共享按鈕時它沒有要求用戶名和密碼,應用程序只需登錄使用舊用戶登錄詳細信息。這是一個應用程序,將被來自單個設備的許多用戶使用。所以每當一個新用戶使用我的應用程序時,他/她應該被重定向到一個新的登錄頁面。從谷歌加註銷後從Android應用程序共享
分享我用下面的代碼: -
shareButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Launch the Google+ share dialog with attribution to your app.
Intent shareIntent = new PlusShare.Builder(HomeActivity.this)
.setType("text/plain")
.setText("Welcome to the Google+ platform.")
.setContentUrl(Uri.parse("https://developers.google.com/+/"))
.getIntent();
startActivityForResult(shareIntent, 0);
}
});
我用下面的代碼來實現的計劃,但似乎問題仍然存在。
if (mGoogleApiClient.isConnected()) {
Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);
Plus.AccountApi.revokeAccessAndDisconnect(mGoogleApiClient)
.setResultCallback(new ResultCallback<Status>() {
@Override
public void onResult(Status status) {
mGoogleApiClient.disconnect();
}
});
}
private void revokeGplusAccess() {
if (mGoogleApiClient.isConnected()) {
Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);
Plus.AccountApi.revokeAccessAndDisconnect(mGoogleApiClient)
.setResultCallback(new ResultCallback<Status>() {
@Override
public void onResult(Status arg0) {
Log.e(TAG, "User access revoked!");
mGoogleApiClient.connect();
updateUI(false);
}
});
}
}
是他們的一種方法,而不是谷歌整合從android應用程序共享?
任何幫助表示讚賞
問候
阿賈伊
我已經更新了我的代碼,並使用過之前的鏈接。分享後,用戶應該從谷歌加註銷,當其他用戶點擊共享按鈕時,它應該需要填寫的細節進行 – Ajay
你是什麼意思,「它應該需要填寫的細節開始」? – Jas
語法錯誤: - 在谷歌加分享後,用戶應該從谷歌加註銷,當其他用戶點擊分享按鈕時,他/她應該需要填寫他/她的細節分享在谷歌加。 我還在我的應用程序中集成了facebook sdk,並且每次用戶點擊登錄按鈕他/她都重定向到webview中的facebook登錄頁面。爲此,我從我的Android設備中刪除了Facebook應用程序 – Ajay