2013-01-21 28 views
0

在我的android phonegap應用程序中我已經使用createchooser從移動設備使用plugin.Its獲得所有共享應用程序工作正常分享,但是當我嘗試在postToWall頁面文本框中輸入facebook應用程序自動關閉,並顯示錯誤logcat.I在三星galaxy選項卡(android 2.2)面臨這個問題。問題同時在facebook分享android

這裏是我的代碼:

Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); 
emailIntent.setType("text/plain"); 
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,"www.google.com"); 
this.ctx.startActivity(Intent.createChooser(emailIntent, "Share:")); 

這裏是我的logcat錯誤:

01-23 07:08:42.865: I/dalvikvm(4054): threadid=3: reacting to signal 3 
01-23 07:08:42.875: I/dalvikvm(4054): Wrote stack traces to '/data/anr/traces.txt'. 

煩請幫我解決this.Thanks提前。

+0

讓我們檢查的http://計算器問題/ 14411789/android-phonegap-version-2-0-or-higher-any-update-for-share-plugin-for-facebook?answertab = active#tab-top 我希望你能得到適當的解。 – MSTdev

+0

@Imran謝謝你的答覆。我已經嘗試過,但它在android 2.2中不能正常工作。請幫我解決這個問題。 – JavaH

回答

0

它可能是爲需要把HTTP一樣簡單://你的網址

面前,你可能知道,原生的Android分享至Facebook只接受一個URL,別無其他。共享文本或文本+網址不工作(在屁股痛) - 所以它可能認爲這是一個字符串,除非你把HTTP://

例如:

Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); 
emailIntent.setType("text/plain"); 
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,"http://www.google.com"); 
this.ctx.startActivity(Intent.createChooser(emailIntent, "Share:"));