2012-03-28 57 views
0

嗨大家我有一個小問題..我試圖分享文本使用谷歌加應用程序,但最新版本給我一個問題。 當我的意圖「com.google.android.apps.plus」打電話,安卓顯示此對話框分享通過谷歌+ ..對話完成行動與顯示

enter image description here

所以,如果我選擇第一個,文本將被正確地共享,但第二一無所獲。 如果應用程序沒有龍頭安裝我將用戶重定向到市場,在g +下載頁面(這項工作很好)

if (v == plus) { 

       social(2); 
       targetedShareIntent.putExtra(
         android.content.Intent.EXTRA_TEXT, user); 
       targetedShareIntent 

         .setPackage("com.google.android.apps.plus"); 
       startActivity(targetedShareIntent); 

     } 

「V」是一個按鈕和社交檢查,如果應用程序被安裝 任何sugestion?

回答

0

這兩個選項打開谷歌+應用程序?

我想顯示兩個選項,因爲谷歌+的應用程序有兩個活動,category.LAUNCHER ....應用和聊天應用

google plus launchers

PSDT:對不起,我的英語不好!

0

我能得到的G +對話框用下面的代碼來啓動(查詢包管理器,以確保應用程序實際上是安裝在currentContext作爲參數傳遞後):

Intent appIntent = new Intent(Intent.ACTION_SEND); 
String shareText = "Share text goes here"; 
appIntent.setType("text/plain"); 
appIntent.putExtra(Intent.EXTRA_TEXT, shareText); 

//Filters so only the G+ app will launch 
appIntent.setPackage("com.google.android.apps.plus"); 
try { 
    currentContext.startActivity(appIntent); 
} catch (android.content.ActivityNotFoundException e) { 
    Log.d(e.getMessage()); 
} 

開車我的香蕉搞清楚了,所以我想我會試圖拯救別人的麻煩。