auto import from //branches/cupcake/...@130745
This commit is contained in:
@@ -60,6 +60,9 @@ public class SdCardSettings extends Activity
|
||||
Button unmountButton = (Button)findViewById(R.id.sdcard_unmount);
|
||||
unmountButton.setOnClickListener(mUnmountButtonHandler);
|
||||
|
||||
Button formatButton = (Button)findViewById(R.id.sdcard_format);
|
||||
formatButton.setOnClickListener(mFormatButtonHandler);
|
||||
|
||||
mTotalSize = (TextView)findViewById(R.id.total);
|
||||
mUsedSize = (TextView)findViewById(R.id.used);
|
||||
mAvailableSize = (TextView)findViewById(R.id.available);
|
||||
@@ -69,6 +72,8 @@ public class SdCardSettings extends Activity
|
||||
intentFilter.addAction(Intent.ACTION_MEDIA_UNMOUNTED);
|
||||
intentFilter.addAction(Intent.ACTION_MEDIA_MOUNTED);
|
||||
intentFilter.addAction(Intent.ACTION_MEDIA_SHARED);
|
||||
intentFilter.addAction(Intent.ACTION_MEDIA_CHECKING);
|
||||
intentFilter.addAction(Intent.ACTION_MEDIA_NOFS);
|
||||
intentFilter.addAction(Intent.ACTION_MEDIA_BAD_REMOVAL);
|
||||
intentFilter.addAction(Intent.ACTION_MEDIA_SCANNER_STARTED);
|
||||
intentFilter.addAction(Intent.ACTION_MEDIA_SCANNER_FINISHED);
|
||||
@@ -198,6 +203,15 @@ public class SdCardSettings extends Activity
|
||||
}
|
||||
};
|
||||
|
||||
OnClickListener mFormatButtonHandler = new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
try {
|
||||
mMountService.formatMedia(Environment.getExternalStorageDirectory().toString());
|
||||
} catch (RemoteException ex) {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
private int mStatus;
|
||||
private IMountService mMountService;
|
||||
|
Reference in New Issue
Block a user