package de.tudarmstadt.informatik.hostage.ui; import de.tudarmstadt.informatik.hostage.logging.DatabaseHandler; import de.tudarmstadt.informatik.hostage.logging.Record; import android.app.Activity; import android.os.Bundle; import android.widget.ScrollView; import android.widget.TextView; /** * Creates a simple log view. Shows the Information for every attack. The format ist defined in {@link Record#toString(int)}. * @author Lars Pandikow * */ public class ViewLogTable extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); DatabaseHandler dbh = new DatabaseHandler(getBaseContext()); String log = ""; //Create a log entry for every attack in the Database for(Record record: dbh.getRecordOfEachAttack()) { log = log + record.toString(2) + "\n"; } ScrollView scroll = new ScrollView(this); TextView text = new TextView(getApplicationContext()); text.setText(log); text.setTextAppearance(this, android.R.style.TextAppearance_Medium); scroll.addView(text); setContentView(scroll); } }