use of com.ushahidi.android.app.helpers.ActionModeHelper in project Ushahidi_Android by ushahidi.
the class ListMapFragment method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
setHasOptionsMenu(true);
mListMapModel = new ListMapModel();
this.dialog = new ProgressDialog(getActivity());
this.dialog.setCancelable(true);
this.dialog.setIndeterminate(true);
this.dialog.setMessage(getString(R.string.please_wait));
if (Util.isHoneycomb()) {
listView.setLongClickable(true);
listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
listView.setOnItemLongClickListener(new ActionModeHelper(this, listView));
} else {
registerForContextMenu(listView);
}
// filter map list
if (view != null) {
if (view.mSearchMap != null) {
view.mSearchMap.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable arg0) {
}
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (!(TextUtils.isEmpty(s.toString()))) {
filter = s.toString();
mHandler.post(filterMapList);
} else {
mHandler.post(fetchMapList);
}
}
});
}
}
if (savedInstanceState != null) {
int position = savedInstanceState.getInt(STATE_CHECKED, -1);
if (position > -1) {
listView.setItemChecked(position, true);
}
}
}
Aggregations