title: How to start a new activity from a fragment calss by clicking on Linearlayout within fragment? below is my code but this is not working
body: <p>when i click on linearlayout within a fragment it dose't give any error but do not start new activity. Is there any error in my code? please someone help me. 
  This fragment xml file code of my project. </p>
  
  <p>Fragment_one.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      &gt;
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:orientation="vertical"
          android:layout_weight="1"
          &gt;
          &lt;LinearLayout
              android:id="@+id/Lbid"
              android:layout_width="wrap_content"
              android:layout_marginTop="30dp"
              android:layout_height="wrap_content"&gt;
              &lt;ProgressBar
  
                  style="?android:attr/progressBarStyleHorizontal"
                  android:id="@+id/pbb"
                  android:layout_marginLeft="15dp"
                  android:layout_width="180dp"
                  android:layout_height="25dp"
                  android:progress="50"
                  android:progressDrawable="@drawable/bidonpb"
  
                  /&gt;
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Bid on"
                  android:id="@+id/tv"
                  android:layout_marginLeft="2dp"
                  /&gt;
          &lt;/LinearLayout&gt;
  
          &lt;LinearLayout
              android:id="@+id/Lap"
              android:layout_width="wrap_content"
              android:layout_marginTop="20dp"
  
              android:layout_height="wrap_content"&gt;
              &lt;ProgressBar
  
                  style="?android:attr/progressBarStyleHorizontal"
                  android:id="@+id/pbap"
                  android:layout_marginLeft="15dp"
                  android:layout_width="180dp"
                  android:layout_height="25dp"
                  android:progress="60"
                  android:progressDrawable="@drawable/appb"
  
                  /&gt;
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Awaiting Payments"
                  android:layout_marginLeft="2dp"
                  /&gt;
          &lt;/LinearLayout&gt;
          &lt;LinearLayout
              android:id="@+id/LO"
              android:layout_width="wrap_content"
              android:layout_marginTop="20dp"
  
              android:layout_height="wrap_content"&gt;
              &lt;ProgressBar
  
                  style="?android:attr/progressBarStyleHorizontal"
                  android:id="@+id/pbo"
                  android:layout_marginLeft="15dp"
                  android:layout_width="180dp"
                  android:layout_height="25dp"
                  android:progress="20"
                  android:progressDrawable="@drawable/opb"
  
                  /&gt;
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Overdue"
                  android:layout_marginLeft="2dp"
                  /&gt;
          &lt;/LinearLayout&gt;
          &lt;LinearLayout
  
              android:layout_width="wrap_content"
              android:layout_marginTop="20dp"
              android:id="@+id/LA"
              android:layout_height="wrap_content"&gt;
              &lt;ProgressBar
  
                  style="?android:attr/progressBarStyleHorizontal"
                  android:id="@+id/pba"
                  android:layout_marginLeft="15dp"
                  android:layout_width="180dp"
                  android:layout_height="25dp"
  
                  android:progress="45"
                  android:progressDrawable="@drawable/assignedpb"
  
                  /&gt;
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Assigned"
                  android:layout_marginLeft="2dp"
                  /&gt;
  
          &lt;/LinearLayout&gt;
  
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>This fragment java class code of my project. </p>
  
  <p><strong>FragmentOne.java</strong></p>
  
  
  
  <pre class="lang-js prettyprint-override"><code>  info.androidhive.listviewfeed;
   import android.app.Fragment;
   import android.content.Intent;
   import android.os.Build;
   import android.os.Bundle;
   import android.view.LayoutInflater;
   import android.view.View;
   import android.view.ViewGroup;
   import android.widget.LinearLayout;
   import android.widget.ProgressBar;
  
  public class FragmentOne extends Fragment {
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,     Bundle savedInstanceState) {
  
          View view = inflater.inflate(R.layout.fragment_one, container, false);
          LinearLayout lbid =(LinearLayout) view.findViewById(R.id.Lbid);
  
          lbid.setOnClickListener(new View.OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  Intent intent = new Intent(getActivity(), ProjectDetails.class);
                 startActivity(intent);
              }
          });
  
          return inflater.inflate(
                  R.layout.fragment_one, container, false);
  
      }
  }
  </code></pre>