private void handleIncomingMessage(Message message) { Bundle data = message.peekData(); long millis = 0; if (data != null) { millis = data.getLong("millis"); } MinderApplication.getAppContext().unbindService(mConnection); listener.returnNextTime(millis); }
@Override public void getNextTime(long millis) { Intent matcherIntent = new Intent(); matcherIntent.setComponent(matcher); matcherIntent.putExtra("millis", millis); matcherIntent.putExtra("values", values); matcherIntent.putExtra("messenger", new Messenger(handler)); try { MinderApplication.getAppContext() .bindService(matcherIntent, mConnection, Context.BIND_AUTO_CREATE); } catch (SecurityException e) { // TODO: Decide how to handle invalid calls in production } }
private OptionCollector() throws ClassNotFoundException { addPotentialOptions(); sortPotentialOptions(); context = MinderApplication.getAppContext(); resolver = context.getContentResolver(); }