Buggy code:
public class TestFragment2 extends Fragment { private static final String ARG_PARAM1 = "param1" ; private static final String ARG_PARAM2 = "param2" ; private String mParam1 ; private String mParam2 ; String [ ] ministry_structure ; ArrayAdapter < String > adapter ; Fragment mFragment ; FragmentManager manager ; Button structure ; Button budget ; Button citizen_charter ; Button work_distribution ; Button planning ; Bundle args ; private TestFragment2 . OnFragmentInteractionListener mListener ; public static TestFragment2 newInstance ( String param1 , String param2 ) { } public TestFragment2 ( ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { View view = inflater . inflate ( fragment_test_fragment2 , container , false ) ; manager = getFragmentManager ( ) ; mFragment = new PDFFragment ( ) ; args = new Bundle ( ) ; structure = ( ( Button ) ( view . findViewById ( button1 ) ) ) ; structure . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { args . putString ( "URL" , "https:////docs.google.com//gview?embedded=true&url=http:////modmr.portal.gov.bd//sites//default//files//files//modmr.portal.gov.bd//page//26cc4d99_9e09_41bd_9f47_6a13e4eb206a//gazate_to_create_modmr_-.pdf" ) ; mFragment . setArguments ( args ) ; manager . beginTransaction ( ) . replace ( content_frame , mFragment ) . addToBackStack ( mFragment . toString ( ) ) . commit ( ) ; } } ) ; budget = ( ( Button ) ( view . findViewById ( button2 ) ) ) ; budget . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { args . putString ( "URL" , "https:////docs.google.com//gview?embedded=true&url=http:////modmr.portal.gov.bd//sites//default//files//files//modmr.portal.gov.bd//files//a6ca58b1_94bc_40ed_986c_69207ddafec3//merged.compressed.pdf" ) ; mFragment . setArguments ( args ) ; manager . beginTransaction ( ) . replace ( content_frame , mFragment ) . addToBackStack ( mFragment . toString ( ) ) . commit ( ) ; } } ) ; citizen_charter = ( ( Button ) ( view . findViewById ( button3 ) ) ) ; citizen_charter . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { args . putString ( "URL" , "https:////docs.google.com//gview?embedded=true&url=http:////modmr.portal.gov.bd//sites//default//files//files//modmr.portal.gov.bd//files//a10af50c_c7c6_4005_b42f_2ca3d98d638c//_______%2000%20_1_.pdf" ) ; mFragment . setArguments ( args ) ; manager . beginTransaction ( ) . replace ( content_frame , mFragment ) . addToBackStack ( mFragment . toString ( ) ) . commit ( ) ; } } ) ; work_distribution = ( ( Button ) ( view . findViewById ( button4 ) ) ) ; work_distribution . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { args . putString ( "URL" , "https:////docs.google.com//gview?embedded=true&url=http:////modmr.portal.gov.bd//sites//default//files//files//modmr.portal.gov.bd//page//dea9e4c1_e6a6_4e70_bc80_b086908abcb0//Kormo%20bonton%20Final%20-N.pdf" ) ; mFragment . setArguments ( args ) ; manager . beginTransaction ( ) . replace ( content_frame , mFragment ) . addToBackStack ( mFragment . toString ( ) ) . commit ( ) ; } } ) ; planning = ( ( Button ) ( view . findViewById ( button5 ) ) ) ; planning . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { args . putString ( "URL" , "https:////docs.google.com//gview?embedded=true&url=http:////modmr.portal.gov.bd//sites//default//files//files//modmr.portal.gov.bd//files//f3e9a165_31c6_4c32_a5ff_f11bbc8bb7d6//RTI%20Work%20Plan%202015_Nikosh01_1_.pdf" ) ; mFragment . setArguments ( args ) ; manager . beginTransaction ( ) . replace ( content_frame , mFragment ) . addToBackStack ( mFragment . toString ( ) ) . commit ( ) ; } } ) ; ministry_structure = getResources ( ) . getStringArray ( ministry_formulation ) ; LinearLayout ll = ( ( LinearLayout ) ( view . findViewById ( R . id . ministry_structure ) ) ) ; LinearLayout . LayoutParams params = new LinearLayout . LayoutParams ( LayoutParams . MATCH_PARENT , LayoutParams . MATCH_PARENT ) ; int dpValue = 20 ; float d = getResources ( ) . getDisplayMetrics ( ) . density ; int margin = ( ( int ) ( dpValue * d ) ) ; params . setMargins ( margin , margin , margin , margin ) ; ll . setBackgroundDrawable ( getResources ( ) . getDrawable ( layout_bg ) ) ; ll . setPadding ( margin , margin , margin , margin ) ; ll . setOrientation ( VERTICAL ) ; ll . setLayoutParams ( params ) ; for ( int i = 0 ; i < ( ministry_structure . length ) ; i ++ ) { TextView tv1 = new TextView ( container . getContext ( ) ) ; tv1 . setText ( Html . fromHtml ( ministry_structure [ i ] ) ) ; tv1 . setTextColor ( getResources ( ) . getColor ( text_color ) ) ; <START_BUG> tv1 . setTextSize ( COMPLEX_UNIT_DIP , 14 ) ; <END_BUG> ll . addView ( tv1 ) ; } return view ; } public void onButtonPressed ( Uri uri ) { } @ Override public void onAttach ( Activity activity ) { } @ Override public void onDetach ( ) { } public interface OnFragmentInteractionListener { public void onFragmentInteraction ( Uri uri ) { } } }

Fix:
tv1 . setTextSize ( COMPLEX_UNIT_DIP , 18 ) ;