title: freeing memory from Fragments
body: <p>I want to know what happens to the variables/objects that exist inside a fragment after it is destroyed. For example the FloatingActionButton its a instance that leaves inside fragment. When the fragment gets destroyed does the FloatingActionButton also? or do i need to free the memory myself? Also, the finish method on destroyed, do i need to call it?</p>
  
  <pre><code>public class Hello extends Fragment {
  
  private final Fragment fragment = this;
  
  @Nullable
  @Override
  public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
  
      return inflater.inflate(R.layout.content_main, container, false);
  }
  
  @Override
  public void onStart() {
      FloatingActionButton fab = (FloatingActionButton) getActivity().findViewById(R.id.fab);
      fab.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
  
  
      });
      super.onStart();
  }
  
  
  
  @Override
  public void onDestroy() {
      Log.d("ButtonScan","Destroyed");
      try {
          finalize();
      } catch (Throwable throwable) {
          throwable.printStackTrace();
      }
      super.onDestroy();
  }
  }
  </code></pre>