2013-03-04 38 views
1

我想在给定的用户配置文件中从我的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的应用程序,但留在我的个人资料屏幕上,而不是给定的配置文件。

有什么想法?

+0

FourSquare提供某种支持吗? – 2013-03-04 13:49:42

+0

用户或用户?该URL看起来像这样,http://m.foursquare.com/user?uid=USER_ID – springrolls 2013-03-04 14:07:19

+0

@codingcrow在[Foursquare官方文档](https://developer.foursquare.com/overview/support)中,它们指定为在API上使用stackoverflow的问题。 – 2013-03-04 14:32:21

回答

0

嗯,这些意图似乎目前不按预期工作。我们的工程师正在努力解决这个问题,我们会不断更新。

如果您立即需要解决方案,也许在WebView中打开用户的配置文件? (例如,https://foursquare.com/user/620652

+0

您可以预计在下一个版本中这个问题会得到解决。 – octopi 2013-03-05 19:24:08

相关问题