Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 使用api通过地理定位发送twitter状态_Android_Twitter - Fatal编程技术网

Android 使用api通过地理定位发送twitter状态

Android 使用api通过地理定位发送twitter状态,android,twitter,Android,Twitter,我已经使用twitter4j API在我的android应用程序中集成了TwitterAPI,我想用地理位置发送状态,为此我使用了这种方法 public void updateStatus(String status,GeoLocation geo) throws Exception { try { mTwitter.updateStatus(status,geo); } catch (TwitterException e) { throw

我已经使用twitter4j API在我的android应用程序中集成了TwitterAPI,我想用地理位置发送状态,为此我使用了这种方法

    public void updateStatus(String status,GeoLocation geo) throws Exception {
    try {
        mTwitter.updateStatus(status,geo);
    } catch (TwitterException e) {
        throw e;
    }
}
而且地球观测组织也有

     geo=new GeoLocation(location.getLatitude(),location.getLongitude());
结果,mesage被发布了,但是twit中没有查看位置,所以有人能帮我吗 将我的地理位置添加到twit状态
thx重播

Concat地理位置和您的状态

mTwitter.updateStatus(status + ": " + geo);

你看到留言底部的“你的位置”了吗?如果我误解了,我很抱歉。但是如果消息有位置信息,那么代码就可以工作了?我没有得到u,但是消息被发布了,但是在下面没有查看位置it@steevoo:首先使用if Geolocation.isSupported(如果可能)检查您的设备是否支持此api。。