Code example for Fragment

Methods: getActivityonDestroy

0
                              Context.BIND_AUTO_CREATE);
  } 
 
  @Override 
  public void onDestroy() { 
    getActivity().getApplicationContext().unbindService(this);
    disconnect(); 
 
    super.onDestroy(); 
  } 
 
  @Override 
  public void onClick(View view) {
    EditText script=(EditText)getView().findViewById(R.id.script);
    String src=script.getText().toString();
 
    service.executeScript(src);
  } 
 
  @Override 
Contextual code suggestions in your IDE  Get Codota for Java