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)
public class storenretrieve extends Activity { /** Called when the activity is first created. */ private static class DatabaseHelper extends SQLiteOpenHelper { DatabaseHelper(Context context) { super(context, "Sujay", null, 2); } @Override public void onCreate(SQLiteDatabase db) { db.execSQL("CREATE TABLE " + "MyTable" + " (" + "ID"+ " INTEGER PRIMARY KEY," + "Title" + " TEXT," + "Author"+ " TEXT," + "Price" + " REAL" + ");"); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { Log.w("Db Upgrade", "Upgrading database from version "+ oldVersion + " to " + newVersion+ ", which will destroy all old data"); db.execSQL("DROP TABLE IF EXISTS MyTable"); onCreate(db); } } private DatabaseHelper dbHelper; private Bundle mState; private TableLayout tl; private SQLiteDatabase db; private String sort = "Title"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mState = savedInstanceState; dbHelper = new DatabaseHelper(this); db = dbHelper.getWritableDatabase(); final String selColList[] = { "Title", "Author", "Price" }; Cursor res = db.query("MyTable", selColList, null, null, null, null,sort); LinearLayout ll = new LinearLayout(this); ll.setOrientation(LinearLayout.VERTICAL); ScrollView sv = new ScrollView(this); tl = new TableLayout(this); tl.setStretchAllColumns(true); if (res.getCount() >= 1) { TableRow tr = new TableRow(this); String cols[] = res.getColumnNames(); for (int i = 0; i < cols.length; i++) { TextView tv = new TextView(this); tv.setText(cols[i]); //final Context c = this; // Toast.makeText(c, "Test ", Toast.LENGTH_SHORT).show(); tv.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { // TODO Auto-generated method stub sort = ((TextView) v).getText().toString(); onCreate(mState); return true; } }); tv.setTextSize(20); tr.addView(tv); } tl.addView(tr); ll.addView(tl); tl = new TableLayout(this); tl.setStretchAllColumns(true); while (res.moveToNext()) { tr = new TableRow(this); for (int i = 0; i < res.getColumnCount(); i++) { TextView tv = new TextView(this); tv.setText(res.getString(i)); tv.setTextSize(15); tr.addView(tv); } tl.addView(tr); } } else { TextView tv = new TextView(this); tv.setText("No Records In Table"); tv.setTextSize(20); tl.addView(tv); } res.close(); db.close(); dbHelper.close(); sv.addView(tl); ll.addView(sv); setContentView(ll); } @Override public boolean onCreateOptionsMenu(Menu menu) { // TODO Auto-generated method stub super.onCreateOptionsMenu(menu); menu.add(0, 0, 0, "Insert Row"); menu.add(0, 1, 1, "Show Contents"); menu.add(0, 2, 2, "Clear Contents"); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // TODO Auto-generated method stub super.onOptionsItemSelected(item); switch (item.getItemId()) { case 0: Toast.makeText(this, "Hmm start inserting.. ;)",Toast.LENGTH_SHORT).show(); TableLayout tl = new TableLayout(this); // tl.setLayoutParams(new // ViewGroup.LayoutParams(ViewGroup.MarginLayoutParams.FILL_PARENT,ViewGroup.MarginLayoutParams.FILL_PARENT)); final EditText titleText = new EditText(this); titleText.setHint("Title"); tl.addView(titleText); final EditText authorText = new EditText(this); authorText.setHint("Author"); tl.addView(authorText); final EditText priceText = new EditText(this); priceText.setHint("Price"); tl.addView(priceText); Button okButton = new Button(this); okButton.setText("Insert"); final Context c = this; okButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { ContentValues vals = new ContentValues(); // vals.put("ID", 1); vals.put("Title", titleText.getText().toString()); vals.put("Author", authorText.getText().toString()); try { vals.put("Price", Double.parseDouble(priceText.getText().toString())); } catch (NumberFormatException e) { System.out.println("nfe"); } db=dbHelper.getWritableDatabase(); if (db.insert("MyTable", null, vals) != -1) { Toast.makeText(c, "Data Inserted Successfully",Toast.LENGTH_SHORT); } else { Toast.makeText(c, "Data Insertion Failed",Toast.LENGTH_SHORT); } db.close(); dbHelper.close(); onCreate(mState); } }); tl.addView(okButton); this.addContentView(tl, new LayoutParams(ViewGroup.MarginLayoutParams.FILL_PARENT,ViewGroup.MarginLayoutParams.FILL_PARENT)); break; case 1: Toast.makeText(this, "Hmm jus a sec", Toast.LENGTH_SHORT).show(); onCreate(mState); break; case 2: db.delete("Mytable", null, null); Toast.makeText(this, "All Data Successfully Deleted",Toast.LENGTH_SHORT).show(); onCreate(mState); break; default: return false; } return true; } @Override protected void onStop() { // TODO Auto-generated method stub super.onStop(); db.close(); dbHelper.close(); } }