我想在給定的用戶配置文件中從我的Android應用程序打開Foursquare應用程序。 我跟着官方文檔: https://developer.foursquare.com/resources/client#android在特定用戶配置文件中打開Foursquare Android應用程序
我創建ACTION_VIEW
類型的意圖,給了URI如http://m.foursquare.com/user?uid=USER_ID
,與配置文件的ID我想看到:
Uri uri = Uri.parse("http://m.foursquare.com/user?uid=USER_ID");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
執行上Android 2.3.3和4.2.2,我得到以下行爲:意圖選擇器出現並詢問完成操作的方式(Foursquare或Browser)。當點擊「Foursquare」時,我看到應用程序出現並立即消失。
我可以在日誌貓中看到Intent已啓動。然後,我的片段的onResume
方法被調用沒有Foursquare的失敗的解釋:
03-04 14:40:55.305: I/ActivityManager(2690): Starting: Intent { act=android.intent.action.VIEW dat=http://m.foursquare.com/user?uid=USER_ID flg=0x3800000 cmp=com.joelapenna.foursquared/.BrowsableActivity } from pid 2690
03-04 14:40:55.320: I/OrientationDebug(2690): [pwm] in updateOrientationListenerLp()
03-04 14:40:55.320: V/OrientationDebug(2690): in updateOrientationListenerLp(), Screen status=true, current orientation=-1, SensorEnabled=true
03-04 14:40:55.320: I/OrientationDebug(2690): [pwm] needSensorRunningLp(), return true #4
03-04 14:40:55.320: W/ActivityManager(2690): Trying to launch com.joelapenna.foursquared/.BrowsableActivity
03-04 14:40:55.355: E/ResourceType(4814): Style contains key with bad entry: 0x010102f3
03-04 14:40:55.355: E/ResourceType(4814): Style contains key with bad entry: 0x0101030b
03-04 14:40:55.355: E/ResourceType(4814): Style contains key with bad entry: 0x01010397
03-04 14:40:55.355: E/ResourceType(4814): Style contains key with bad entry: 0x0101039c
03-04 14:40:55.410: D/szipinf(4814): Initializing inflate state
03-04 14:40:55.420: I/OrientationDebug(2690): [pwm] in updateOrientationListenerLp()
03-04 14:40:55.420: V/OrientationDebug(2690): in updateOrientationListenerLp(), Screen status=true, current orientation=1, SensorEnabled=true
03-04 14:40:55.420: I/OrientationDebug(2690): [pwm] needSensorRunningLp(), return true #4
03-04 14:40:55.445: D/MyFragment(6374): onResume
當創建ACTION_VIEW
類型與URI像foursquare://users/USER_ID
的意圖,它啓動Foursquare的應用程序,但留在我的個人資料屏幕上,而不是給定的配置文件。
有什麼想法?
FourSquare提供某種支持嗎? – 2013-03-04 13:49:42
用戶或用戶?該URL看起來像這樣,http://m.foursquare.com/user?uid=USER_ID – springrolls 2013-03-04 14:07:19
@codingcrow在[Foursquare官方文檔](https://developer.foursquare.com/overview/support)中,它們指定爲在API上使用stackoverflow的問題。 – 2013-03-04 14:32:21