package com.mongmx.androidbarcodeexample;

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;
import android.view.MenuItem;

public class MainActivity extends FragmentActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        FragmentManager fragmentManager = getSupportFragmentManager();
        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
        ScanFragment scanFragment = new ScanFragment();
        fragmentTransaction.add(R.id.fragment_container, scanFragment);
        fragmentTransaction.commit();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int id = item.getItemId();
        return id == R.id.action_settings || super.onOptionsItemSelected(item);
    }

}

@@ -486,78 +486,8 @@
 n);%0A
-        FragmentManager fragmentManager = getSupportFragmentManager();
 %0A   
@@ -511,25 +511,17 @@
 saction 
-fragmentT
+t
 ransacti
@@ -525,17 +525,27 @@
 ction = 
-f
+getSupportF
 ragmentM
@@ -550,16 +550,18 @@
 tManager
+()
 .beginTr
@@ -585,73 +585,9 @@
     
-ScanFragment scanFragment = new ScanFragment();%0A        fragmentT
+t
 rans
@@ -622,17 +622,21 @@
 tainer, 
-s
+new S
 canFragm
@@ -642,38 +642,11 @@
 ment
-);%0A        fragmentTransaction
+())
 .com

Update shorten code