【发布时间】:2013-08-22 07:24:50
【问题描述】:
只是一个简单的问题。
我有一个“与 G+ 分享”按钮,我使用最简单的方法集成了该按钮:
https://plus.google.com/share?url=http://...
有没有办法在评论框中插入文字?
如果这里使用的方法不能做到这一点,可以用其他方法吗?
【问题讨论】:
标签: share google-plus
只是一个简单的问题。
我有一个“与 G+ 分享”按钮,我使用最简单的方法集成了该按钮:
https://plus.google.com/share?url=http://...
有没有办法在评论框中插入文字?
如果这里使用的方法不能做到这一点,可以用其他方法吗?
【问题讨论】:
标签: share google-plus
无论您的设备中是否安装了 Google+ 应用程序都应该对您有所帮助,所以请尝试一下...
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
shareMediaButton = (Button) findViewById(R.id.share_button);
shareMediaButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if(isGooglePlusInstalled())
{
PlusShare.Builder share = new PlusShare.Builder(MainActivity.this);
share.setText("write your message here.....!");
//share.addStream(selectedImage);
share.setType("text/plain");
startActivityForResult(share.getIntent(), 0);
}else{
Intent shareIntent = new PlusShare.Builder(MainActivity.this)
.setType("text/plain")
.setText("write your message here.....!")
.getIntent();
startActivityForResult(shareIntent, 0);
}
}
public boolean isGooglePlusInstalled()
{
try
{
getPackageManager().getApplicationInfo("com.google.android.apps.plus", 0 );
return true;
}
catch(PackageManager.NameNotFoundException e)
{
return false;
}
}
});
}
【讨论】: