Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
/*the code i tried so far but it inserting another row, but i want to get the checkout time alongwith checkin time.so how can i update the row?*/
Java
private View.OnClickListener SubmitListener = new OnClickListener() {
		
		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			
			eid = edt_checkout_id.getText().toString();
			ename = edt_checkout_name.getText().toString();
			
			Calendar cal = Calendar.getInstance();
			SimpleDateFormat dateformat = new SimpleDateFormat(
					"dd/MM/yyyy_HH:mm:ss.000");
			FormattedDate = dateformat.format(cal.getTime());
			Log.v("TAG", "FormattedDate=" + FormattedDate);
			
			SQLiteDatabase db = db_activity.getWritableDatabase();
			ContentValues contentValues = new ContentValues();
			contentValues.put(Db_Activity.ID, eid);
			contentValues.put(Db_Activity.Name, ename);
			contentValues.put(Db_Activity.CheckOut_Time, FormattedDate);
			
			long inserted = db.insert(Db_Activity.Table, null, contentValues);
			
			db.close();
			db_activity.close();

			edt_checkout_id.setText("");
			edt_checkout_name.setText("");
			Intent intent1 = new Intent(CheckoutActivity.this,Employee_ProjectActivity.class);
			startActivity(intent1);
			
			Toast.makeText(getBaseContext(),
					"You have been successfully checked out...",
					Toast.LENGTH_SHORT).show();
			
		}
	};
Posted
Updated 1-Feb-14 22:04pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900