Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 73: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 74: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 75: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 76: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 77: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 78: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
package lmu.de.excercise3; import java.lang.String; import android.app.Activity; import android.os.Bundle; import android.widget.Spinner; import android.widget.ArrayAdapter; import android.widget.TextView; import android.widget.Button; import android.view.View; import android.view.View.OnClickListener; import android.widget.EditText; import android.content.SharedPreferences; import android.widget.AdapterView.OnItemSelectedListener; import android.widget.AdapterView; import android.database.sqlite.SQLiteDatabase; import java.io.FileNotFoundException; import java.util.Calendar; import android.content.ContentValues; import android.database.Cursor; import android.util.Log; public class Exercise3 extends Activity { public TextView tv; public EditText et; public Button but, dayButton, allButton; public String start = "Chat starting...\n"; public int selection; public SharedPreferences settings; private int _year; private int _month; private int _day; private int _hour; private int _minute; public static final String DBASE = "chat.db"; public static final String TABLE = "history"; public SQLiteDatabase db = openDB(); private String createTable = "CREATE TABLE " + TABLE + " (_id INTEGER PRIMARY KEY autoincrement, message TEXT, date TEXT, time TEXT); "; private String insert, select, date, time; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); tv = (TextView)findViewById(R.id.text); et = (EditText)findViewById(R.id.message); but = (Button)findViewById(R.id.ok); dayButton = (Button)findViewById(R.id.day); allButton = (Button)findViewById(R.id.all); Spinner s1 = (Spinner) findViewById(R.id.status); ArrayAdapter adapter = ArrayAdapter.createFromResource(this, R.array.status, android.R.layout.simple_spinner_item); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); s1.setAdapter(adapter); tv.setText(start); settings = getSharedPreferences("Preferences", MODE_PRIVATE); selection = settings.getInt("status", 1); s1.setSelection(selection); s1.setOnItemSelectedListener(new OnItemSelectedListener() { SharedPreferences.Editor editor = settings.edit(); public void onItemSelected(AdapterView parent, View v, int position, long id) { switch (position) { default: editor.putInt("status", position); editor.commit(); break; } } public void onNothingSelected(AdapterView parent) { } }); init(); but.setOnClickListener(new OnClickListener() { public void onClick(View v) { if (et.length() != 0) { Calendar c = Calendar.getInstance(); _year = c.get(Calendar.YEAR); _month = c.get(Calendar.MONTH); _day = c.get(Calendar.DAY_OF_MONTH); _hour = c.get(Calendar.HOUR); _minute = c.get(Calendar.MINUTE); date = _year + "-" + _month + "-" + _day; time = _hour + ":" + _minute; tv.setText(tv.getText() + "\n" + "(" + time + ") me: " + et.getText()); et.setText(""); //insert = "insert into chat values (null, '" + et.getText() + "', '" + date + "', '" + time + "')"; //db.execSQL(insert); ContentValues values = new ContentValues(); values.put("message", et.getText().toString()); values.put("date", date); values.put("time", time); db.insert(TABLE, null, values); //db.close(); } } }); dayButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { Calendar c = Calendar.getInstance(); _year = c.get(Calendar.YEAR); _month = c.get(Calendar.MONTH); _day = c.get(Calendar.DAY_OF_MONTH); date = _year + "-0" + _month + "-" + _day; time = _hour + ":" + _minute; select = "SELECT * FROM " + TABLE + " WHERE date = '" + date + "'"; /* String where = "date = '" + date + "'"; //String order = "date asc"; String selections[] = {"message", "time"}; Cursor cur = db.query(TABLE, selections, where, null, null, null, null); */ Cursor cur = db.rawQuery(select, null); if(cur != null) { int num = cur.getColumnIndex("message"); String msg = cur.getString(num); tv.setText(msg); } else { tv.setText("No history available for today."); } //db.close(); } }); } public SQLiteDatabase openDB() { try { return this.openDatabase(DBASE, null); } catch( Exception e ) { return null; } } public void init() { try { db = this.openDatabase(DBASE, null); } catch(FileNotFoundException e) { try { db = this.createDatabase(DBASE, 1, MODE_PRIVATE, null); try { db.execSQL(createTable); Log.e("DEBUGTAG","Error occured", e); } catch(Exception exc) { Log.e("DEBUGTAG","Error occured", exc); } } catch(FileNotFoundException ex) { db = null; } } } }