Methods Summary |
---|
public void | onClick(android.content.DialogInterface dialog, int which){@inheritDoc}
if (which == POSITIVE_BUTTON) {
Intent intent = new Intent(ExternalStorageFormatter.FORMAT_ONLY);
intent.setComponent(ExternalStorageFormatter.COMPONENT_NAME);
startService(intent);
}
// No matter what, finish the activity
finish();
|
protected void | onCreate(android.os.Bundle savedInstanceState)
super.onCreate(savedInstanceState);
Log.d("ExternalMediaFormatActivity", "onCreate!");
// Set up the "dialog"
final AlertController.AlertParams p = mAlertParams;
p.mTitle = getString(com.android.internal.R.string.extmedia_format_title);
p.mMessage = getString(com.android.internal.R.string.extmedia_format_message);
p.mPositiveButtonText = getString(com.android.internal.R.string.extmedia_format_button_format);
p.mPositiveButtonListener = this;
p.mNegativeButtonText = getString(com.android.internal.R.string.cancel);
p.mNegativeButtonListener = this;
setupAlert();
|
protected void | onPause()
super.onPause();
unregisterReceiver(mStorageReceiver);
|
protected void | onResume()
super.onResume();
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_MEDIA_REMOVED);
filter.addAction(Intent.ACTION_MEDIA_CHECKING);
filter.addAction(Intent.ACTION_MEDIA_MOUNTED);
filter.addAction(Intent.ACTION_MEDIA_SHARED);
registerReceiver(mStorageReceiver, filter);
|