payu-intrepos / Android-Custom-Browser

Custom Browser module for SDK
11 stars 9 forks source link

Bank Class is a abstract class .. cant make object of it ... Please help #8

Closed harshitism closed 5 years ago

junaidstalkbylove commented 8 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