@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.status_list); final Cursor statusesCursor = managedQuery( STATUSES_URI, null, KEY_STATUS_PERSONAL + "=0", null, KEY_STATUS_DATE + " DESC "); adapter = new UpdatesListAdapter(this, R.layout.status_row, statusesCursor); setupLoader( new UpdatesListActivity.Loader() { public Boolean load() { try { ServiceHelper.getService() .loadStatuses( m_adapter.getCount(), m_adapter.getCount() + CheckingService.STATUS_NUM_LOAD); } catch (RemoteException e) { e.printStackTrace(); Log.e(TAG, "Loading statuses failed"); } return false; } }, adapter); registerForContextMenu(getListView()); getListView().setOnItemClickListener(this); getListView().setOnScrollListener(this); refreshOnStart(); }