Code example for Fragment

Methods: onStop

0
        // 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(); 
    } 
 
    private void initUIComponents() { 
        Button reverseButton = (Button) getView().findViewById(R.id.reverse_button);
        wordField = (EditText) getView().findViewById(R.id.word_field);
        resultTextView = (TextView) getView().findViewById(R.id.result);
        reverseButton.setOnClickListener(new View.OnClickListener() {
            @Override 
            public void onClick(View view) {
                performRequest(wordField.getText().toString());
            } 
        }); 
    } 
 
    private void performRequest(String searchQuery) {