title: How to call fragment from activity
body: <p>I'm calling a fragment class from an activity  so I am not able to call this fragment class because I'm getting an error which is given below and here is my full code so any one can help me please thanks in advance.</p>
  
  <pre><code>Activity class
  public class Second extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          requestWindowFeature(Window.FEATURE_NO_TITLE);
          getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                  WindowManager.LayoutParams.FLAG_FULLSCREEN);
          setContentView(R.layout.activity_second);
  
      }
  
      public void onClickNext(View view) {
          Intent intent = new Intent(Second.this, MainActivity.class);
          startActivityForResult(intent, 400);
          overridePendingTransition(R.anim.slide_in_top, R.anim.slide_out_bottom);
      }
  
      @Override
      protected void onActivityResult(int requestCode, int resultCode, Intent data) {
          overridePendingTransition(R.anim.slide_in_bottom, R.anim.slide_out_top);
      }
  
      public void btnHome(View view) {
          Intent intent = new Intent(Second.this, Welcome.class);
          startActivity(intent);
      }
  
      public void aboutUsClick(View view) {
          Fragment fragment = null;
          fragment = new AboutFragment();
  
  
          startActivity(new Intent(this, AboutFragment.class));
  
  
      }
  }
  </code></pre>
  
  <p>Fragment class</p>
  
  <pre><code>package com.example.lunetta;
  
  import android.app.Fragment;
  import android.os.Bundle;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  
  public class AboutFragment extends Fragment{
  
  
      public AboutFragment(){
  
      }
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
          View view = inflater.inflate(R.layout.fragment_layout_about, container,
                  false);
          return view;
      }
  
  }
  </code></pre>
  
  <p>Android Manifest</p>
  
  <pre><code> &lt;activity
              android:name="com.example.lunetta.AboutFragment"
              android:label="@string/title_fragment_layout_about" &gt;
   &lt;/activity&gt;
  </code></pre>
  
  <p>I got this type error in log cat</p>
  
  <pre><code>03-30 10:24:34.876: E/AndroidRuntime(5299): FATAL EXCEPTION: main
  03-30 10:24:34.876: E/AndroidRuntime(5299): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.lunetta/com.example.lunetta.AboutFragment}: java.lang.ClassCastException: com.example.lunetta.AboutFragment cannot be cast to android.app.Activity
  03-30 10:24:34.876: E/AndroidRuntime(5299):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
  03-30 10:24:34.876: E/AndroidRuntime(5299):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
  03-30 10:24:34.876: E/AndroidRuntime(5299):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
  03-30 10:24:34.876: E/AndroidRuntime(5299):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
  03-30 10:24:34.876: E/AndroidRuntime(5299):     at android.os.Handler.dispatchMessage(Handler.java:99)
  03-30 10:24:34.876: E/AndroidRuntime(5299):     at android.os.Looper.loop(Looper.java:137)
  03-30 10:24:34.876: E/AndroidRuntime(5299):     at android.app.ActivityThread.main(ActivityThread.java:5041)
  03-30 10:24:34.876: E/AndroidRuntime(5299):     at java.lang.reflect.Method.invokeNative(Native Method)
  03-30 10:24:34.876: E/AndroidRuntime(5299):     at java.lang.reflect.Method.invoke(Method.java:511)
  03-30 10:24:34.876: E/AndroidRuntime(5299):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
  03-30 10:24:34.876: E/AndroidRuntime(5299):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
  03-30 10:24:34.876: E/AndroidRuntime(5299):     at dalvik.system.NativeStart.main(Native Method)
  03-30 10:24:34.876: E/AndroidRuntime(5299): Caused by: java.lang.ClassCastException: com.example.lunetta.AboutFragment cannot be cast to android.app.Activity
  03-30 10:24:34.876: E/AndroidRuntime(5299):     at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
  03-30 10:24:34.876: E/AndroidRuntime(5299):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
  03-30 10:24:34.876: E/AndroidRuntime(5299):     ... 11 more
  </code></pre>