Code example for Fragment

Methods: onStart

0
        return layoutView;
    } 
 
    @Override 
    public void onStart() { 
        super.onStart(); 
        update(); 
    } 
 
    public void update() { 
        try { 
            mDistance.setText(String.format(formatter, meta.getDistance() / ArchiveMeta.TO_KILOMETRE));
            mMaxSpeed.setText(String.format(formatter, meta.getMaxSpeed() * ArchiveMeta.KM_PER_HOUR_CNT));
            mAvgSpeed.setText(String.format(formatter, meta.getAverageSpeed() * ArchiveMeta.KM_PER_HOUR_CNT));
            mRecords.setText(String.valueOf(meta.getCount()));
        } catch (Exception e) {
            Helper.Logger.e(e.getMessage());
        } 
    }