I am new to the android working environment, was following some tutorial regarding fragments, there appears to be no error when i build and run the project but once the app is installed on the emulator i get this message in the dialog saying the app has stopped working
I have spent an entire day looking for a solution now any help will be appreciated here is the source code below: MainActivity.java:
package com.example.fragmentsanotherexample;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.Menu;
public class MainActivity extends FragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    FragmentManager fm=getSupportFragmentManager();
    android.support.v4.app.Fragment fragment=fm.findFragmentById(R.id.fragment_content);
    if(fragment==null){
        FragmentTransaction ft=fm.beginTransaction();
        ft.add(R.id.fragment_content, new BasicFragment());
        ft.commit();
    }
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);
    return true;
}
 }
BasicFragment.java:
package com.example.fragmentsanotherexample;
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.Toast;
public class BasicFragment extends Fragment{
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
    View view=inflater.inflate(R.layout.basic_fragment,container,false);
    Button button=(Button) view.findViewById(R.id.fragment_button);
    button.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
        Activity activity=getActivity();
            if(activity != null){
                Toast.makeText(activity, R.string.hello_world, Toast.LENGTH_LONG).show();
            }
        }
    });
    return view;
}
}
Here is the basic_fragment.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<Button android:id="@+id/fragment_button"
    android:text="@string/btn_fragment"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" />
</LinearLayout>
Here is activiy_main.xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<FragmentLayout
    android:id="@+id/fragment_content"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" />
</LinearLayout>
Here is the manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.fragmentsanotherexample"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />
<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.fragmentsanotherexample.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>
</manifest>
As far as the logcat is concerned it's empty, any sort of help would be really appreciated
 
    