小编use*_*851的帖子

我收到 HttpResponse 但 responce.getEntity().getContent() 显示 NullPointerException

protected String doInBackground(String... urls) {
    String url = urls[0];
    String result = "";

    HttpResponse response = doResponse(url);

    if (response == null) {
        return result;
    } else {

        try {
            result = inputStreamToString(response.getEntity().getContent());

        } catch (IllegalStateException e) {
            Log.e(TAG, e.getLocalizedMessage(), e);

        } catch (IOException e) {
            Log.e(TAG, e.getLocalizedMessage(), e);
        }

    }

    return result;
}
Run Code Online (Sandbox Code Playgroud)

我将把数据发布到下面的数据库中,我附上了剩余的代码,所以请检查并清除我的问题

private HttpResponse doResponse(String url) {

    HttpClient httpclient = new DefaultHttpClient(getHttpParams());

    HttpResponse response = null;

    try {
        switch (taskType) {

        case POST_TASK:
            HttpPost httppost = new HttpPost(url); …
Run Code Online (Sandbox Code Playgroud)

java android http

2
推荐指数
1
解决办法
2万
查看次数

android v2 mapview中的中心固定标记

我想mapview在拖动地图的同时在中心点设置固定标记.它已在android Map V1 google上完成mapview.但现在它已被弃用.现在我的问题是,它是否有可能在android Map V2谷歌mapview?(我试过.但地图没有显示)

android android-layout android-fragments android-activity

2
推荐指数
2
解决办法
6030
查看次数