Android Intent将在Google+社区屏幕上发布Google+应用

Mar*_*ark 5 android android-intent google-plus

在Google+ Android应用中显示Google+信息页已经有了一个很好的问题:

打开谷歌加威盛意图在Android中

但对意图如何在一个特定的Google+社群推出Google+应用?

编辑 - 沉默向下选民,请解释一下你为什么下投票.

out*_*ing 6

我的解决方案,使用G +版本"5.3.0.91034052",今天进行了测试

final Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse( "https://plus.google.com/communities/107847486351510098159" ) );
intent.setPackage( "com.google.android.apps.plus" );
if (intent.resolveActivity(getPackageManager()) != null) { 
    startActivity( intent );
}
Run Code Online (Sandbox Code Playgroud)

这不是防弹,你需要在你的设备上使用Google+应用程序,如果你没有它,某种尝试捕获可能会很好(?),

  • 相反,try-catch你可以解决意图```if(sendIntent.resolveActivity(getPackageManager())!= null){startActivity(sendIntent); }``` (2认同)