@Override public void onCreate(Bundle icicle){
  super.onCreate(icicle);
  setContentView(R.layout.main);
  File path=Environment.getDataDirectory();
  StatFs stat=new StatFs(path.getPath());
  int totalBlocks=stat.getBlockCount();
  mBlockSize=(int)(stat.getBlockSize());
  TextView startSizeTextView=(TextView)findViewById(R.id.totalsize);
  startSizeTextView.setText(Long.toString((totalBlocks * mBlockSize) / BYTE_SIZE));
  Button button=(Button)findViewById(R.id.button_run);
  button.setOnClickListener(mStartListener);
}

@ Override public void onCreate ( Bundle icicle ) { super . onCreate ( icicle ) ; setContentView ( R . layout . main ) ; File path = Environment . getDataDirectory ( ) ; StatFs stat = new StatFs ( path . getPath ( ) ) ; int totalBlocks = stat . getBlockCount ( ) ; mBlockSize = ( int ) ( stat . getBlockSize ( ) ) ; TextView startSizeTextView = ( TextView ) findViewById ( R . id . totalsize ) ; startSizeTextView . setText ( Long . toString ( ( totalBlocks * mBlockSize ) / BYTE_SIZE ) ) ; Button button = ( Button ) findViewById ( R . id . button_run ) ; button . setOnClickListener ( mStartListener ) ; }
called when the activity is first created .
