Closed harshitism closed 5 years ago
Create your own inner fragment and extends with the Bank.
public static class MyBank extends Bank{ @Override public void registerBroadcast(BroadcastReceiver broadcastReceiver, IntentFilter filter) { mReceiver = broadcastReceiver; getActivity().registerReceiver(broadcastReceiver, filter); }
@Override public void unregisterBroadcast(BroadcastReceiver broadcastReceiver) { if (mReceiver != null) { getActivity().unregisterReceiver(mReceiver); mReceiver = null; } } @Override public void onHelpUnavailable() { getActivity().findViewById(R.id.parent).setVisibility(View.GONE); getActivity().findViewById(R.id.trans_overlay).setVisibility(View.GONE); } @Override public void onBankError() { getActivity().findViewById(R.id.parent).setVisibility(View.GONE); getActivity().findViewById(R.id.trans_overlay).setVisibility(View.GONE); } @Override public void onHelpAvailable() { getActivity().findViewById(R.id.parent).setVisibility(View.VISIBLE); } }
Make receiver as static. Thanks, Junaid
Create your own inner fragment and extends with the Bank.
public static class MyBank extends Bank{ @Override public void registerBroadcast(BroadcastReceiver broadcastReceiver, IntentFilter filter) { mReceiver = broadcastReceiver; getActivity().registerReceiver(broadcastReceiver, filter); }
Make receiver as static. Thanks, Junaid