Hi i got a data that is scan from the QR
code with contain DateTime
. but now i want to make a validation where , the code will proceed to another activity when its scan only date and time . I post the code here
Log.i("<<<<<<Asset Code>>>>> ",
"<<<<Bar Code>>> " + sym.getData());
scanResult = sym.getData().trim();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
if(scanResult.equals(dateFormat))
{
new createClockIn().execute();
}
else {
Toast.makeText(BarcodeScanner.this, "Sorry this is not a valid date and time", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(getApplicationContext(), BarcodeScanner.class);
intent.putExtra("username", staffIDStr1);
startActivity(intent);
}
but this is seems to be wrong when im scan the qr code with the date and time , its pops out the toast. The data should be inserted to the database like this