Ejemplo n.º 1
0
 private void end() {
   Session currSession = SessionData.currentSession(this);
   // Return to a new ticket edit
   switch (Configure.getTicketsMode(this)) {
     case Configure.SIMPLE_MODE:
       TicketInput.requestTicketSwitch(currSession.newTicket());
       this.finish();
       break;
     case Configure.STANDARD_MODE:
       if (!currSession.hasTicket()) {
         TicketInput.requestTicketSwitch(currSession.newTicket());
         this.finish();
         break;
       } // else open ticket input like in restaurant mode
     case Configure.RESTAURANT_MODE:
       Intent i = new Intent(this, TicketSelect.class);
       i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
       this.startActivityForResult(i, TicketSelect.CODE_TICKET);
       break;
   }
 }
Ejemplo n.º 2
0
 protected void onActivityResult(int requestCode, int resultCode, Intent data) {
   PaylevenApi.handleIntent(requestCode, data, new PaylevenResultHandler());
   switch (requestCode) {
     case TicketSelect.CODE_TICKET:
       switch (resultCode) {
         case Activity.RESULT_CANCELED:
           // Back to start
           Intent i = new Intent(this, Start.class);
           i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
           this.startActivity(i);
           break;
         case Activity.RESULT_OK:
           TicketInput.requestTicketSwitch(SessionData.currentSession(this).getCurrentTicket());
           this.finish();
           break;
       }
   }
 }