private void myTitleDialog() { final Dialog setTitle = new Dialog(this); setTitle.setContentView(R.layout.titlesetter); setTitle.setTitle("Set Title Text"); db.open(); Cursor V = db.getRecord("title", 1); String title = V.getString(1); db.close(); final EditText newTitle = (EditText) setTitle.findViewById(R.id.setNewTitle); newTitle.setText(title); newTitle.requestFocus(); setTitle.show(); Button submitTitle = (Button) setTitle.findViewById(R.id.button2); submitTitle.setOnClickListener( new View.OnClickListener() { public void onClick(View view) { String input = newTitle.getText().toString(); Log.i("titleTest", "-->" + input); try { db.open(); db.updateTitle(1, input); } catch (SQLException sqle) { throw sqle; } db.close(); vgp1.updateMain(); // mview.updateAll(); setTitle.dismiss(); } }); }
private void loadDatesV() { Log.i("Main", "MainLoadDB"); db.open(); Cursor V = db.getRecord("dates", 1); String[] StartDate = V.getString(1).split("/"); Sday = Integer.parseInt(StartDate[0]); Smonth = Integer.parseInt(StartDate[1]); Syear = Integer.parseInt(StartDate[2]); String[] EndDate = V.getString(2).split("/"); Eday = Integer.parseInt(EndDate[0]); Emonth = Integer.parseInt(EndDate[1]); Eyear = Integer.parseInt(EndDate[2]); db.close(); }