private void handleUserAuthed(Context context, Intent intent) { Log.d(TAG, "handleUserAuthed: " + intent); final String username = intent.getStringExtra(KegtabBroadcast.USER_AUTHED_EXTRA_USERNAME); final String tapName = intent.getStringExtra(KegtabBroadcast.DRINKER_SELECT_EXTRA_TAP_NAME); final TapManager tapManager = KegbotCore.getInstance(context).getTapManager(); if (!Strings.isNullOrEmpty(tapName)) { final KegTap tap = tapManager.getTapForMeterName(tapName); AuthenticatingActivity.startAndAuthenticate(context, username, tap); } else { AuthenticatingActivity.startAndAuthenticate(context, username, (KegTap) null); } }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final TapManager tapManager = KegbotCore.getInstance(getActivity()).getTapManager(); mTaps.addAll(tapManager.getTaps()); mAdapter = new KegTapAdapter( getActivity(), android.R.layout.simple_list_item_activated_1, android.R.id.text1, mTaps); mBus = KegbotCore.getInstance(getActivity()).getBus(); mBus.register(this); }