@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.file_select_layout); msisdn = getIntent().getStringExtra(HikeConstants.Extras.MSISDN); items = (ArrayList<FileListItem>) HikeConversationsDatabase.getInstance() .getSharedMedia(msisdn, HikeConstants.MAX_MEDIA_ITEMS_TO_LOAD_INITIALLY, -1, false); listAdapter = new FileListAdapter(this, items); emptyView = (TextView) findViewById(R.id.search_empty_view); listView = (ListView) findViewById(R.id.file_list); listView.setEmptyView(emptyView); listView.setAdapter(listAdapter); listView.setOnItemClickListener( new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { FileListItem item = items.get(i); HikeFile.openFile( item.getFile(), item.getHikeSharedFile().getFileTypeString(), SharedOtherFilesActivity.this); } }); listView.setOnScrollListener(this); setupActionBar(); }
@Override protected void onPause() { // TODO Auto-generated method stub super.onPause(); if (listAdapter != null) { listAdapter.getFileImageLoader().setExitTasksEarly(true); } }
@Override public void onResume() { super.onResume(); if (listAdapter != null) { listAdapter.getFileImageLoader().setExitTasksEarly(false); listAdapter.notifyDataSetChanged(); } }