title: create activity inside fragment and Nothing happens when onListItemClick is called
body: <p>Hi I have the following code and 2 questions in the code Q1 and Q2</p>
  
  <p><strong>Q1)</strong> I have read on this site that you can't create a new Activity from inside a fragment, so if I'm inside a fragment and would like to do</p>
  
  <pre><code>Intent intent = new Intent(this, DetailActivity.class);
  startActivity(intent);
  </code></pre>
  
  <p>how do I do it?</p>
  
  <hr>
  
  <p><strong>Q2)</strong>
  Also it seems like I don't get into my onListItemClick, am I'm doing something wrong here, is the OnListItemsClick missplaced or what?</p>
  
  <p>I have the file ActionBarMain.java that creates a new fragment Fragment1.java bellow</p>
  
  <p>//ActionbarMain.java</p>
  
  <pre><code>        fram1 = new FragMent1();
          fragMentTra.addToBackStack(null);
          fragMentTra = getFragmentManager().beginTransaction().add(rl.getId(), fram1, "fram1");
  
  
  //Fragment1.java
      import android.app.Fragment;
      import android.content.Intent;
      import android.os.Bundle;
      import android.util.Log;
      import android.view.LayoutInflater;
      import android.view.View;
      import android.view.ViewGroup;
      import android.widget.ArrayAdapter;
      import android.widget.ListView;
  
      public class FragMent1 extends Fragment {
  
      private String[] bookNames;
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
          ListView listView = new ListView(getActivity());
          ArrayAdapter&lt;String&gt; array = new ArrayAdapter&lt;String&gt;(getActivity(),
                  android.R.layout.simple_list_item_1);
  
          bookNames= bookNames();
  
  
  
          for (String str : bookNames)
              array.add(str);
          listView.setAdapter(array);
          return listView;
      }
  
      private String[] bookNames(){
          SimpleBookManager.getSimpleBookManager().count();
          bookNames = new String[SimpleBookManager.getSimpleBookManager().count()]; 
          for(int i=0; i &lt; SimpleBookManager.getSimpleBookManager().count(); i++){
              bookNames[i]= SimpleBookManager.getSimpleBookManager().getBook(i).getTitle();
          }
          return bookNames;
      }
  
      public void onListItemClick(ListView l, View v, int position, long id) {
          //Q1)Nothing happens here nothing is printed out and I get no errors when I click on
          //an Item in the list, its like it don't come here, why?
          Log.d("test", SimpleBookManager.getSimpleBookManager().getBook(position).getTitle());
          Log.d("test", "jje");
  
          //Q2)Call the DetailActivity.java how to achive this since I'm inside a fragment?   
      }
  }
  </code></pre>