123456789101112131415161718192021222324252627282930313233343536 |
- package de.tudarmstadt.informatik.hostage.ui;
- import de.tudarmstadt.informatik.hostage.format.LogViewFormatter;
- 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());
- StringBuffer log = new StringBuffer();
- //Create a log entry for every attack in the Database
- for(Record record: dbh.getAllRecords()) {
- log.append(record.toString(0));
- }
-
- 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);
- }
- }
|