ViewLogTable.java 830 B

123456789101112131415161718192021222324252627282930
  1. package de.tudarmstadt.informatik.hostage.ui;
  2. import de.tudarmstadt.informatik.hostage.logging.DatabaseHandler;
  3. import de.tudarmstadt.informatik.hostage.logging.SQLRecord;
  4. import android.app.Activity;
  5. import android.os.Bundle;
  6. import android.widget.ScrollView;
  7. import android.widget.TextView;
  8. public class ViewLogTable extends Activity{
  9. @Override
  10. protected void onCreate(Bundle savedInstanceState) {
  11. super.onCreate(savedInstanceState);
  12. DatabaseHandler db = new DatabaseHandler(getBaseContext());
  13. String log = "";
  14. for(SQLRecord record: db.getAllRecords())
  15. {
  16. log = log + record.toString() + "\n";
  17. }
  18. ScrollView scroll = new ScrollView(this);
  19. TextView text = new TextView(getApplicationContext());
  20. text.setText(log);
  21. scroll.addView(text);
  22. setContentView(scroll);
  23. }
  24. }