アプリでGoogle+の特定のコードを共有しようとしていますが、ユーザーが公式のGoogle+アプリをインストールしている場合は正常に機能します。それでも、インストールされていない場合は、ドキュメントによると、アプリがインストールされていないことをユーザーに通知するポップアップが表示され、ボタンをクリックすると、アプリをGooglePlayにリダイレクトしてダウンロードする必要があります。 ..しかし、ボタンをクリックしても何も起こりません。
何かアイデアをお願いしますか?これは私のボタンのコードです:
plus.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
shareDialog.dismiss();
// Launch the Google+ share dialog with attribution to your app.
Intent shareIntent = ShareCompat.IntentBuilder.from(getActivity()).setType("text/plain").setText("Welcome to the Google+ platform. https://developers.google.com/+").getIntent()
.setPackage("com.google.android.apps.plus");
int errorCode = GooglePlusUtil.checkGooglePlusApp(getActivity());
if (errorCode != GooglePlusUtil.SUCCESS) {
GooglePlusUtil.getErrorDialog(errorCode, getActivity(), 1).show();
} else {
startActivity(shareIntent);
}
}
});
よろしくお願いします!