I am creating notepad application and want to update my notes but I am unable to record in sqlite database. Please check my update query I am sharing error details.
public class MainUpdateActivity extends Activity {
SQLiteDatabase mydb1;
EditText titleedit,notetextedit;
Button update;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
titleedit=(EditText)findViewById(R.id.title);
notetextedit=(EditText)findViewById(R.id.notetext);
update=(Button) findViewById(R.id.update);
Intent myintent = getIntent();
String product7 = myintent.getStringExtra("product1");
String product8 = myintent.getStringExtra("product");
titleedit.setText(product7);
notetextedit.setText(product8);
update.setOnClickListener(new View.OnClickListener()
{
public void onClick(View v)
{
mydb1.execSQL("UPDATE notes SET (title,notetext) values(?,?);",new String[]{titleedit.getText().toString(),notetextedit.getText().toString()});
Toast.makeText(getApplicationContext(), "note Updated", 3000).show();
Intent myIntent1 = new Intent(MainUpdateActivity.this,menu.class);
startActivity(myIntent1);
finish();
}
});