@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mDownloadMan = AcApp.getDownloadManager(); mBar = getSupportActionBar(); mBar.setTitle("下载管理"); if (!AcApp.isExternalStorageAvailable()) { setContentView(R.layout.no_sd_layout); return; } setContentView(R.layout.list_layout); Intent service = new Intent(this, DownloadService.class); bindService(service, conn, BIND_AUTO_CREATE); mStateArray = getResources().getStringArray(R.array.download_state); // TODO 换成popupwindow或者其他的显示方式 ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource( mBar.getThemedContext(), R.array.download_state, android.R.layout.simple_spinner_item); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); mBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); mBar.setListNavigationCallbacks(adapter, this); initView(); }