/**
   * Creates the activity
   *
   * @param savedInstanceState the previous saved instance
   */
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    PreLoginActivity.getAct().finish();
    CaseStudy.createDatabase(this);
    TextView scoreDisplay = (TextView) findViewById(R.id.ls_display);
    scoreDisplay.setText("");
    /*for (int i = 0; i<100; i++){
        if (CaseStudy.addCaseStudy("id"+i, "name", "desc", "type", "location") == -1){
            //scoreDisplay.append("Duplicate case\n");
        }
    }*/

    // scoreDisplay.append(CaseStudy.getAllCaseString());
    csl = CaseStudy.getAllCaseStudy();

    listview = (ListView) findViewById(R.id.cs_listview);
    /*String[] values = new String[] { "Android", "iPhone", "WindowsMobile",
            "Blackberry", "WebOS", "Ubuntu", "Windows7", "Max OS X",
            "Linux", "OS/2", "Ubuntu", "Windows7", "Max OS X", "Linux",
            "OS/2", "Ubuntu", "Windows7", "Max OS X", "Linux", "OS/2",
            "Android", "iPhone", "WindowsMobile" };

    */
    this.drawCSList();
  }
 /**
  * Create a new CaseStudy object
  *
  * @param loc the location of the case study
  * @param context the context for accessing the database file
  */
 public CaseStudy(String loc, Context context) {
   this.location = loc;
   this.hist = new History();
   this.context = context;
   this.type = "DISK";
   this.cacheJSON();
   this.PRIMARY_KEY =
       CaseStudy.addCaseStudy(this.id, this.getJSONName(), this.getJSONDesc(), loc, this.type);
   // this.load(); //load data from the database
 }