Code example for Fragment

Methods: onViewCreated, update

0
        } 
    } 
 
    @Override 
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        update(false); 
    } 
 
    @Override 
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return contentView;
    } 
 
    @Override 
    public void onResume() { 
        super.onResume(); 
        if (broadcastReceiver == null) {
            broadcastReceiver = new UIBroadcastReceiver(getActivity(), this);
        } 
        broadcastReceiver.attach();