本文整理了Java中android.widget.ExpandableListView.setOnItemLongClickListener()
方法的一些代码示例,展示了ExpandableListView.setOnItemLongClickListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ExpandableListView.setOnItemLongClickListener()
方法的具体详情如下:
包路径:android.widget.ExpandableListView
类名称:ExpandableListView
方法名:setOnItemLongClickListener
暂无
代码示例来源:origin: SecUSo/privacy-friendly-netmonitor
expListView.setOnItemLongClickListener(new ExpandableListView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
代码示例来源:origin: gigabytedevelopers/FireFiles
@Override
public void onResume() {
super.onResume();
final Context context = getActivity();
final State state = ((BaseActivity) context).getDisplayState();
state.showAdvanced = state.forceAdvanced
| SettingsActivity.getDisplayAdvancedDevices(context);
state.rootMode = SettingsActivity.getRootMode(getActivity());
if (state.action == ACTION_BROWSE) {
mList.setOnItemLongClickListener(mItemLongClickListener);
} else {
mList.setOnItemLongClickListener(null);
mList.setLongClickable(false);
}
getLoaderManager().restartLoader(2, null, mCallbacks);
}
代码示例来源:origin: SecUSo/privacy-friendly-todo-list
TextView emptyView = (TextView) v.findViewById(R.id.tv_empty_view_no_tasks);
expandableListView = (ExpandableListView) v.findViewById(R.id.exlv_tasks);
expandableListView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
代码示例来源:origin: SecUSo/privacy-friendly-todo-list
public void updateAdapter() {
dbhelper = DatabaseHelper.getInstance(this);
ArrayList<TodoTask> tasks;
tasks = DBQueryHandler.getBin(dbhelper.getReadableDatabase());
expandableTodoTaskAdapter = new ExpandableTodoTaskAdapter(this, tasks);
lv.setAdapter(expandableTodoTaskAdapter);
lv.setEmptyView(tv);
lv.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
int groupPosition = ExpandableListView.getPackedPositionGroup(id);
if (ExpandableListView.getPackedPositionType(id) == ExpandableListView.PACKED_POSITION_TYPE_CHILD) {
int childPosition = ExpandableListView.getPackedPositionChild(id);
expandableTodoTaskAdapter.setLongClickedSubTaskByPos(groupPosition, childPosition);
} else {
expandableTodoTaskAdapter.setLongClickedTaskByPos(groupPosition);
}
registerForContextMenu(lv);
return false;
}
});
}
代码示例来源:origin: SecUSo/privacy-friendly-todo-list
private void showAllTasks() {
dbHelper = DatabaseHelper.getInstance(this);
ArrayList<TodoTask> tasks;
tasks = DBQueryHandler.getAllToDoTasks(dbHelper.getReadableDatabase());
expandableTodoTaskAdapter = new ExpandableTodoTaskAdapter(this, tasks);
exLv.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
int groupPosition = ExpandableListView.getPackedPositionGroup(id);
if (ExpandableListView.getPackedPositionType(id) == ExpandableListView.PACKED_POSITION_TYPE_CHILD) {
int childPosition = ExpandableListView.getPackedPositionChild(id);
expandableTodoTaskAdapter.setLongClickedSubTaskByPos(groupPosition, childPosition);
} else {
expandableTodoTaskAdapter.setLongClickedTaskByPos(groupPosition);
}
registerForContextMenu(exLv);
return false;
}
});
exLv.setAdapter(expandableTodoTaskAdapter);
exLv.setEmptyView(tv);
optionFab.setVisibility(View.VISIBLE);
initFab(true, 0, false);
hints();
}
内容来源于网络,如有侵权,请联系作者删除!