2013-06-06 5 views
1

에서 위치 이외의 값을 돌려 나는이 코드 조각이 : 내가 ArrayList에에서 목록보기를 장착하고, 다른 활동으로 이동할 수 있습니다목록보기

ListView lista = (ListView)findViewById(android.R.id.list); 
    lista.setOnItemClickListener(new OnItemClickListener() { 
     public void onItemClick(AdapterView<?> parent, View view, int position, long id) { 
      arquivo = Retorno.retArquivo.get(position); 
      Intent trocatela = new Intent(Popular.this,Detalhe.class); 
      Popular.this.startActivity(trocatela); 
      Popular.this.finish(); 
     } 
    }); 

을, 모든 작품을 좋아,하지만 난 값을 얻을 필요 그것이 목록에 있습니다.

편집 : 위치보다

다른 값.

EDIT2 :

private List<Resultados> populateSampleApplication() { 

     List<Resultados> list = new ArrayList<Resultados>(); 

     int total = Retorno.retArquivo.size(); 

     for (int i = 0; i < total; i++) { 
      if (Retorno.retTipo.get(i).equals(Login.tipo)) { 
       Resultados ap = new Resultados(); 
       ap.setNome(Retorno.retNome.get(i)); 
       ap.setArquivo(Retorno.retArquivo.get(i)); 
       ap.setDados(Retorno.retDados.get(i)); 
       ap.setExibido(Retorno.retExibido.get(i)); 
       ap.setReconhecido(Retorno.retReconhecido.get(i)); 
       list.add(ap); 
      } 
     } 

     return list; 
    } 

그리고이 다시 얻을 필요가 :

내가 여기에 값을 설정 ap.setArquivo(Retorno.retArquivo.get(i));

+0

어떤 값이 필요하며이 값은 어디에 있습니까? – tyczj

+0

lista.getAdapter()가 필요에 맞는가? – Piovezan

답변

0

도와 줘서 고마워. 이 작업 방식 :

String tx2 = ((TextView)view.findViewById(R.id.arquivo)).getText().toString(); 
2
당신이 목록보기를 만드는 데 사용되는 어댑터를 가지고 얻을 수

해당 위치의 데이터

Resultados ap = (Resultados)adapter.getItem(position); 

데이터는 그 위치는