Code example for Fragment

Methods: getActivity, onStart

0
        initUIComponents(); 
    } 
 
    @Override 
    public void onStart() { 
        super.onStart(); 
        spiceManager.start(getActivity());
        if (wordField.getText() != null) {
            spiceManager.addListenerIfPending(String.class, wordField.getText().toString(), new ReverseStringRequestListener());
        } 
    } 
 
    @Override 
    public void onStop() { 
        // Please review https://github.com/octo-online/robospice/issues/96 for the reason of that 
        // ugly if statement. 
        if (spiceManager.isStarted()) {
            spiceManager.shouldStop();
        } 
        super.onStop(); 
    }