title: Android NewBie - facing issue for setAdapter ListView
body: <p>I am totally new to Android and trying for Fragments for the first time.
  I have used a ListView activity which I am converting in a fragment.
  But somehow the ListView element retrieved by findViewById() is giving me null.
  Can anyone please help me on this.?</p>
  
  <p>Here is the code for ListView Fragment and I m getting error after I call setAdapter method.
  Log value shows timeTrackerListView as null.I dont know why.!! :(</p>
  
  <pre><code> package ray.kaushik.nasaapp;
  
  import android.app.Fragment;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ListView;
  
  public class TimeTracker extends Fragment{
      private Time_Tracker_Adapter timeTrackerAdapter;
      private String TAG = "TimeTracker";
      public void onCreate(Bundle savedInstanceState){
          super.onCreate(savedInstanceState);
          timeTrackerAdapter = new Time_Tracker_Adapter();
  
      }
  
      public View onCreateView(LayoutInflater inflater,ViewGroup container, Bundle savedInstanceState){
              return inflater.inflate(R.layout.time__tracker_layout, container, false);
      }
  
      public void onActivityCreated(Bundle savedInstanceState){
          super.onActivityCreated(savedInstanceState);
          ListView timeTrackerListView = (ListView) getActivity().findViewById(R.id.time_tracker_List);
          Log.i(TAG, "timeTrackerListView--&gt;" + timeTrackerListView);
          timeTrackerListView.setAdapter(timeTrackerAdapter);
      }
  }
  </code></pre>