Minor nitpicking: launching of activity from ApduService not in background thread
Opened this issue · 0 comments
suzukieng commented
You forgot to spawn off the thread. Not sure if it matters though, as startActivity apparently forces itself to execute on the main thread anyway.
private void startPaymentActivityInBackgroundThread() {
new Runnable() {
@Override
public void run() {
//Start Payment Activity
Intent intent = new Intent(getApplicationContext(), PayActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
getApplicationContext().startActivity(intent);
//Vibrate
Vibrator v = (Vibrator) getApplicationContext().getSystemService(Context.VIBRATOR_SERVICE);
v.vibrate(500);
}
}.run();
}