Code example for Fragment

Methods: getActivity, onDestroy

0
  public void onDestroy() { 
    if (mgr!=null) {
      mgr.removeUpdates(this);
    } 
     
    getActivity().getApplicationContext().unbindService(this);
    super.onDestroy(); 
  } 
   
  private void goBlooey(Throwable t) {
    AlertDialog.Builder builder=new AlertDialog.Builder(getActivity());
     
    builder
      .setTitle("Exception!")
      .setMessage(t.toString())
      .setPositiveButton("OK", null)
      .show();
  } 
   
  static String generatePage(ArrayList<Forecast> forecasts) {
    StringBuilder bufResult=new StringBuilder("<html><body><table>");