2017-04-12 11 views
0

私はwebviewでアンドロイドアプリケーションを持っています。 FBやInstagramのような外部リンクをクリックすると、新しいChromeウィンドウが開きます.Google +をクリックすると、アプリケーションがWebview内で開きます。私はG +をラッパーから開けたい(達成された)が、特定のプロファイルにリダイレクトすることもできる。 これは私のコードです:google plusの代わりにwebviewをラッパーから開いてください

Intent intent = new Intent(Intent.ACTION_VIEW); 
intent.setData(Uri.parse("https://plus.google.com/profile/posts")); 
startActivity(intent); 

私はそれはしたくないラッパーの内側上記のコードのオープンGの+ ..

PackageManager pm = getPackageManager(); 
Intent launchIntent = pm.getLaunchIntentForPackage("com.google.android.apps.plus"); 
if (launchIntent != null) { 
//intent.setClassName("com.google.android.apps.plus", 
      // "com.google.android.apps.plus.phone.UrlGatewayActivity"); 
launchIntent.putExtra("customAppUri",profile); 
startActivity(launchIntent);} 

上記のコードは実際にはラッパーのうち、G +アプリケーションを開きますプロファイルページにはリダイレクトされません。

提案がありますか?

答えて

0

明らかに、G +の活動名は「com.google.android.libraries.social.gateway.GatewayActivity」に変更されています。それに応じて更新し、それは完璧に動作します!

更新されたコード:

PackageManager pm = getPackageManager(); 
    Intent launchIntent = 
    pm.getLaunchIntentForPackage("com.google.android.apps.plus"); 
    if (launchIntent != null) { 
    intent.setClassName("com.google.android.apps.plus", 
     "com.google.android.libraries.social.gateway.GatewayActivity"); 
    launchIntent.putExtra("customAppUri",profile); 
    startActivity(launchIntent);} 
関連する問題