title: How can i use intent in Fragment class for redirecting to another class?
body: <p>In my fragment class i have some buttons so when i click that buttons i want to redirect to another Activity class. How can i use redirection in fragment class?</p>
  
  <p><strong><em>fragment_services.xml</em></strong>
      `
       </p>
  
  <pre><code>&lt;ScrollView
      android:layout_width="fill_parent"
      android:layout_height="fill_parent" &gt;
      &lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="409dp" &gt;
  &lt;Button
      android:id="@+id/button3"
      style="?android:attr/buttonStyleSmall"
      android:layout_width="160dp"
      android:layout_height="90dp"
      android:layout_alignParentLeft="true"
      android:layout_below="@+id/textView1"
      android:layout_marginTop="18dp"
      android:background="@drawable/cloud" /&gt;
   &lt;/RelativeLayout&gt;
   &lt;/ScrollView&gt;
   &lt;/RelativeLayout&gt;`
  </code></pre>
  
  <p><strong>ServiceFragment.java</strong></p>
  
  <pre><code>public class ServiceFragment extends Fragment {
  private Context CurrentObj=this;
   @Override
   public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) 
   {
       View rootView = inflater.inflate(R.layout.fragment_services, container,   false);
       final Button backBtn=(Button)findViewById(R.id.button3);
       backBtn.setOnClickListener(new OnClickListener()
       {
              @Override
              public void onClick(View arg0)
              {
                  // TODO Auto-generated method stub
                  Intent redirect=new Intent(CurrentObj.getApplicationContext(),Cloud.class);
                  startActivity(redirect);
              }
          });
       return rootView;
   }
  </code></pre>
  
  <p>}</p>
  
  <p><strong><em>Cloud.java</em></strong></p>
  
  <pre><code>public class Cloud extends Activity{
  private Context CurrentObj=this;
  @Override
  
  protected void onCreate(Bundle savedInstanceState)
  {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.cloud);
  }
  </code></pre>
  
  <p>}</p>