package com.modalitaprovvisoria.readfile;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import android.app.Activity;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
public class MainActivity extends Activity {
String stringhe[] = {"", "", "", "", "", "", "", "", "", "", "", "", ""};
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tutti);
new leggoinback().execute("");
private class leggoinback extends AsyncTask<String, Void, String> {
protected String doInBackground(String... params) {
URL indirizzoFile= new URL("http://www.modalitaprovvisoria.it/prova.txt");
BufferedReader tutto = new BufferedReader(new InputStreamReader(indirizzoFile.openStream()));
while ((leggo = tutto.readLine()) != null) {
} catch (MalformedURLException e) {
} catch (IOException e) {
protected void onPostExecute(String result) {
for (int j=0;j<stringhe.length;j++){
Log.d("LEGGO", stringhe[j]);
Toast.makeText(MainActivity.this, stringhe[j], Toast.LENGTH_SHORT).show();
protected void onPreExecute() {}