Ver Mensaje Individual
  #6  
Viejo 23/08/13, 23:31:18
Avatar de Cristofer2006
Cristofer2006 Cristofer2006 no está en línea
Usuario novato en la web
Mensajes: 4
 
Fecha de registro: ago 2013
Mensajes: 4
Modelo de smartphone: SIII Mini
Tu operador: Movistar
Mencionado: 0 comentarios
Tagged: 0 hilos
Funciona a la perfección usando ArrayList, muchas gracias

copio el código por si a alguien le puede servir:

Código:
            int indice=0;
	    String linea;
            TextView tv1;
            ListView lv1;
            ArrayList<String> datos=new ArrayList<String>();
		
		Bundle bundle = getIntent().getExtras();
		String autor = bundle.getString("autor");
		int resource = getResources().getIdentifier(autor, "raw", "proyec.to1");
		
		try
		{
		    InputStream fraw = getResources().openRawResource(resource);
		    BufferedReader brin = new BufferedReader(new InputStreamReader(fraw));
		    
		    while((linea = brin.readLine()) != null){
		    datos.add(linea);
		    }
		    
			lv1=(ListView)findViewById(R.id.listView1);
			lv1.setAdapter(new ArrayAdapter<String>(this, R.layout.list_item, datos));
		    
		    fraw.close();
		}
		catch (Exception ex)
		{
		    Log.e("Ficheros", "Error al leer fichero.");
		}
Saludos cordiales
Responder Con Cita