Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void printJobReceipt(final String id, final List<Printer> printer) {
- new MyAsyncTask(new CallBackTask() {
- @Override
- public void setData(final Order order) {
- try {
- List<String> activeReceiptId = PreferenceUtils.readList(MainActivity.this, Preferences.ACTIVE_PRINTER_LISTRECEIPT, "");
- for (int i = 0; i < printer.size(); i++) {
- Log.v("Printer",printer.get(i).getUuid()+"");
- for (int j = 0; j < activeReceiptId.size(); j++) {
- if (printer.get(i).getUuid().equals(activeReceiptId.get(j))) {
- PrintJob pj = new StaticPaymentPrintJob.Builder().order(order).build();
- pj.print(MainActivity.this, account, printer.get(i));
- }
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- // Toast.makeText(MainActivity.this, "Exception o payment " + e.getMessage(), Toast.LENGTH_SHORT).show();
- }
- MainActivity.this.finish();
- }
- }).execute(id);
- }
Add Comment
Please, Sign In to add comment