if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { TextView textView = (TextView) findViewById(R.id.textView); textView.setText("SD 卡不存在,請插入 SD 卡!"); }