0

「テキスト」形式のjsonを取得していますが、「画像」を取得できません。

public class JsonSampleActivity extends ListActivity {

private Context context;

// url to make request
private static String url = "http://www.bounty4u.com/android/sample_json.txt";

    //JSON Node names
 private static final String TAG_TITLE = "name";
 private static final String TAG_IMAGE = "url";

    // contacts JSONArray
    ArrayList<HashMap<String, String>> jsonlist = new ArrayList<HashMap<String, String>>();

ListView lv ;


    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    new ProgressTask(JsonSampleActivity.this).execute();

    }



private class ProgressTask extends AsyncTask<String, Void, Boolean> {

    private ListActivity activity;

        public ProgressTask(ListActivity activity) {
        this.activity = activity;
        context = activity;

    }

    /** progress dialog to show user that the backup is processing. */

    /** application context. */
    private Context context;

    protected void onPreExecute() {

    }

    @Override
    protected void onPostExecute(final Boolean success) {

        ListAdapter adapter = new SimpleAdapter(context, jsonlist,
                R.layout.list_item, new String[] { TAG_TITLE, TAG_IMAGE },
                new int[] { R.id.title, R.id.image1 });

        setListAdapter(adapter);


    }

    protected Boolean doInBackground(final String... args) {

        JsonParser jParser = new JsonParser();

        // getting JSON string from URL
        JSONArray json = jParser.getJSONFromUrl(url);

        for (int i = 0; i < json.length(); i++) {

            try {
                JSONObject c = json.getJSONObject(i);
               String vfuel = c.getString(TAG_TITLE);
               String vimage = c.getString(TAG_IMAGE);

                HashMap<String, String> map = new HashMap<String, String>();


                map.put(TAG_TITLE, vfuel);
                map.put(TAG_IMAGE,vimage);

                jsonlist.add(map);
            } catch (JSONException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }

        return null;
    }


}

エラーが発生しています: resolveUri が不正なビットマップ URI で失敗しました: http://www.bounty4u.com/android/images/angie.jpg

何が問題なのか教えてください。

4

0 に答える 0