第三方应用支持

进入扫码页面:

Intent intent = new Intent();

intent.setAction("com.gaocang.fatcat.scan");

intent.addCategory("android.intent.category.DEFAULT");

intent.putExtra("fatcat.continue", true); //是否连续扫描模式

startActivity(intent);


获取扫码结果:

BroadcastReceiver receiver = new BroadcastReceiver() {

@Override

public void onReceive(Context context, Intent intent) {

//结果

List data

= intent.getStringArrayListExtra("fatcat.data");

}

};

private void registerCat() {

IntentFilter filter = new IntentFilter("com.gaocang.fatcat.result");

registerReceiver(receiver, filter);

}

private void unRegisterCat() {

unregisterReceiver(receiver);

}

你可能感兴趣的:(第三方应用支持)