O meu codigo abre um ficheiro txt da net e coloca-o numa textview. O problema é que ele junta as linhas todas. Como fazer para quebrar as linhas?
Outra dúvida é como eliminar as tags do ficheiro de texto e não quebrar os links rtmp e rtmpe. ja que com os http não há nenhum problema ao converter para link
package com.tvmix.read;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class ReadFileAssetsActivity extends Activity {
TextView textMsg;
final String textSource = "https://dl.dropboxusercontent.com/s/w7ga6shmocr23x4/Eventos.txt?dl=0";
@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
textMsg = (TextView) findViewById(R.id.textmsg);
URL textUrl;
try {
textUrl = new URL(textSource);
BufferedReader bufferReader = new BufferedReader(new InputStreamReader(textUrl.openStream()));
String StringBuffer;
String stringText = "";
while ((StringBuffer = bufferReader.readLine()) != null) {
stringText += StringBuffer;
}
bufferReader.close();
textMsg.setText(stringText);
} catch (MalformedURLException e) {
e.printStackTrace();
textMsg.setText(e.toString());
} catch (IOException e) {
e.printStackTrace();
textMsg.setText(e.toString());
}
}