Então na verdade até ai to sabendo, uma imagem até ja sei fazer
exibir, o problema é que não to conseguindo criar um Adpter
personalizado para as imagens, ainda não compreendi como fazer isso:
ListAdapter adapter = new SimpleAdapter(this, itemstList,
R.layout.list_item,
new String[] { TAG_TITLE, TAG_SUBTITLE, TAG_PUBLISHER,
TAG_PUBLISHERDATE, TAG_DESCRIPTION}, new int[] {
R.id.title, R.id.subtitle, R.id.publish,
R.id.date,
R.id.description);
setListAdapter(adapter);
ListView lv = getListView();
Para as imagens, a minha pesquisa retorna vários resultados e tem
texto e uma imagem por resultado.
On Jun 19, 7:02 am, Jilles Ragonha <jill...@gmail.com> wrote:
> tem q pegar o endereço da imagem via input stream
> depois usa o bitmap.setdecodefactory(ou algo parecido rs)
>
> Em 18 de junho de 2012 10:39, Regis Sabino <regis.sab...@gmail.com>escreveu:
>
>
>
>
>
>
>
>
>
>
>
> >http://stackoverflow.com/questions/4509912/is-it-possible-to-use-bitm...
>
> > Em 17 de junho de 2012 12:14, Giovani Arduini <giov...@sorocabacom.com>escreveu:
>
> > Olá galera !
>
> >> Me desculpe se não era para abrir um novo topico, mas como disse em um
> >> topico anterior eu consegui exibir em um ListView o resultado da
> >> busca, com retorno JSON porem ele retorna o caminho de uma imagem, mas
> >> não estou conseguindo exibir essa imagem, alguem tem uma dica meu
> >> odigo é esse:
>
> >> Parabens pelo post muito bom, porém eu estou tentado implementar ele
> >> no meu codigo e não do conseguindo se você poder me dar uma dica
> >> agradeço. O caminho da imagem vem de um retorno em JSON ou seja a
> >> imagem esta na net. Meu codigo é esse:
>
> >> ArrayList<HashMap<String, String>> itemstList = new
> >> ArrayList<HashMap<String, String>>();
>
> >> JSONParser jParser = new JSONParser();
>
> >> JSONObject json = jParser.getJSONFromUrl(url);
>
> >> try {
> >> retono = json.getJSONArray(TAG_RETORNO);
>
> >> for(int i = 0; i < retono.length(); i++){
> >> JSONObject c = retono.getJSONObject(i);
>
> >> String title = c.getString(TAG_TITLE);
> >> String subtitle = c.getString(TAG_SUBTITLE);
> >> String publisher = c.getString(TAG_PUBLISHER);
> >> String publishedDate = c.getString(TAG_PUBLISHERDATE);
> >> String description = c.getString(TAG_DESCRIPTION);
> >> String smallThumbnail =
> >> c.getString(TAG_SMALLTHUMNAIL);
>
> >> HashMap<String, String> map = new HashMap<String,
> >> String>();
>
> >> // adding each child node to HashMap key => value
> >> map.put(TAG_TITLE, title);
> >> map.put(TAG_SUBTITLE, subtitle);
> >> map.put(TAG_PUBLISHER, publisher);
> >> map.put(TAG_PUBLISHERDATE, publishedDate);
> >> map.put(TAG_DESCRIPTION, description);
> >> map.put(TAG_SMALLTHUMNAIL, smallThumbnail);
>
> >> itemstList.add(map);
> >> }
> >> } catch (JSONException e) {
> >> e.printStackTrace();
> >> }
>
> >> ListAdapter adapter = new SimpleAdapter(this, itemstList,
> >> R.layout.list_item,
> >> new String[] { TAG_TITLE, TAG_SUBTITLE, TAG_PUBLISHER,
> >> TAG_PUBLISHERDATE, TAG_DESCRIPTION}, new int[] {
> >> R.id.title, R.id.subtitle, R.id.publish, R.id.date,
> >> R.id.description);
>
> >> setListAdapter(adapter);
>
> >> ListView lv = getListView();
>
> > --
> > Sabino, Regis S.
> > Programmer - Web Designer - Full .NET Platform
> > (55) 11 8545-9314 / (55) 11 2456-7901
>
> > Some people, when confronted with a problem, think "I know, I'll use
> > regular expressions." Now they have two problems.
>
> --
> *
> __________________________________________________________________________________
> *
> *
> *
> *JILLES RAGONHA
> Twitter: @jillesragonha
> Google Talk: jill...@gmail.com
> MSN: jilles.rago...@hotmail.com <jillesrago...@hotmail.com>
> *
> *Email: cont...@jillesragonha.com.br*
> *
> *
> *_______________________________*
> ___________________________________________________
[androidbrasil-dev] Re: Imagem Json
05:48 |
Assinar:
Postar comentários (Atom)






0 comentários:
Postar um comentário