我有以下问题...... I m implementing a QR代码
fish in my android application..., which is carried out this int
:
Intent intent = new Intent(
"com.google.zxing.client.android.SCAN");
intent.setPackage("com.google.zxing.client.android");
intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
startActivityForResult(intent, 0);
换言之,我开始使用<条码>《巴斯堪纳编码>。
Want I want to do is launch this application and even if the user starts scanning a barcode or not the application will close automatically after two minutes.
当然,如果用户关闭,意味着时间。
我尝试执行<条码>。 类似于:
<>载在上
initTask=new InitTask();
initTask.execute();
<>斯特凡>
private class InitTask extends AsyncTask<Void,Void,Void>{
protected Void doInBackground(Void...unused){
new Runnable() {
@Override
public void run() {
try {
Thread.sleep(20000);
}
catch (InterruptedException e) {
e.printStackTrace();
}
Intent intent = new Intent(
"com.google.zxing.client.android.SCAN");
intent.setPackage("com.google.zxing.client.android");
intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
startActivityForResult(intent, 0);
}
}.run();
this.cancel(true);
return null;
}
}
<>斯特凡>
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
//..........
}
The problem is that the app gets opened but it doesn t close automatically after 2 minutes. Does someone know how could I achieve that?