Buggy code:
public class PlantInfoFragment extends Fragment { int plantInt = 0 ; View view ; ListView lv1 ; ImageView iv ; boolean isRunning = true ; public PlantInfoFragment ( int plantInt ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onDestroy ( ) { } private void addInfoLoop ( ) { Thread t = new Thread ( new Runnable ( ) { ArrayList < String > info = new ArrayList < String > ( ) ; @ SuppressWarnings ( "unchecked" ) @ Override public void run ( ) { ListView lv = ( ( ListView ) ( view . findViewById ( listView3 ) ) ) ; lv1 = lv ; getActivity ( ) . runOnUiThread ( new Runnable ( ) { @ Override public void run ( ) { lv1 . setAdapter ( new ArrayAdapter < String > ( getActivity ( ) . getBaseContext ( ) , layout . simple_list_item_1 ) ) ; } } ) ; while ( isRunning ) { info = new ArrayList < String > ( ) ; WeedPlant wp = weedArray . get ( plantInt ) ; info . add ( ( ( "Water:<seq2seq4repair_space>" + ( wp . getWater ( ) ) ) + "%" ) ) ; info . add ( ( "Quality:<seq2seq4repair_space>" + ( wp . getQuality ( ) ) ) ) ; info . add ( ( ( "Health:<seq2seq4repair_space>" + ( wp . getHealth ( ) ) ) + "%" ) ) ; info . add ( ( wp . isSick ( ) ? "This<seq2seq4repair_space>plant<seq2seq4repair_space>is<seq2seq4repair_space>sick" : "This<seq2seq4repair_space>plant<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>sick" ) ) ; info . add ( wp . getGrowth ( ) ) ; iv = ( ( ImageView ) ( view . findViewById ( imageView1 ) ) ) ; getActivity ( ) . runOnUiThread ( new Runnable ( ) { @ Override public void run ( ) { try { ( ( android . widget . SimpleAdapter ) ( ( ( InfoFragment ) ( ( ( com . ocelotworks . weedsim . StartActivity ) ( getActivity ( ) ) ) . getFragment ( ) ) ) . getListView ( ) . getAdapter ( ) ) ) . notifyDataSetChanged ( ) ; } catch ( Exception e ) { } ( ( ArrayAdapter < String > ) ( lv1 . getAdapter ( ) ) ) . clear ( ) ; ( ( ArrayAdapter < String > ) ( lv1 . getAdapter ( ) ) ) . addAll ( info ) ; ( ( ArrayAdapter < String > ) ( lv1 . getAdapter ( ) ) ) . notifyDataSetChanged ( ) ; ProgressBar pBar = ( ( ProgressBar ) ( view . findViewById ( pBar ) ) ) ; WeedPlant wp = weedArray . get ( plantInt ) ; <START_BUG> pBar . setProgress ( ( ( int ) ( ( double ) ( ( ( ( double ) ( wp . getAge ( ) ) ) // 72000 ) * 100 ) ) ) ) ; <END_BUG> try { getActivity ( ) . getActionBar ( ) . setTitle ( ( "Plant<seq2seq4repair_space>Status<seq2seq4repair_space>-<seq2seq4repair_space>Plant<seq2seq4repair_space>" + ( ( plantInt ) + 1 ) ) ) ; } catch ( Exception e ) { } getImage ( ) ; } private void getImage ( ) { int plantGrowth = weedArray . get ( plantInt ) . getGrowthStage ( ) ; int imageId = drawable . ic_plant_seeding ; switch ( plantGrowth ) { case 0 : { imageId = drawable . ic_plant_seeding ; break ; } case 1 : { if ( weedArray . get ( plantInt ) . isSick ( ) ) { imageId = drawable . ic_plant_germ_sick ; } else { imageId = drawable . ic_plant_germ ; } break ; } case 2 : { if ( weedArray . get ( plantInt ) . isSick ( ) ) { imageId = drawable . ic_plant_flower_sick ; } else { imageId = drawable . ic_plant_flower ; } break ; } case 3 : { if ( weedArray . get ( plantInt ) . isSick ( ) ) { imageId = drawable . ic_plant_grow_sick ; } else { imageId = drawable . ic_plant_grow ; } break ; } case 4 : { imageId = drawable . ic_plant_harvest ; break ; } case 5 : { imageId = drawable . ic_plant_harvest ; break ; } default : { break ; } } iv . setImageResource ( imageId ) ; } } ) ; try { Thread . sleep ( 500 ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } } } } ) ; t . start ( ) ; } public void water ( ) { } public void harvest ( ) { } }

Fix:
pBar . setProgress ( ( ( int ) ( ( double ) ( ( ( ( double ) ( wp . getAge ( ) ) ) // 1200 ) * 100 ) ) ) ) ;