本文整理了Java中android.widget.GridView.performItemClick()
方法的一些代码示例,展示了GridView.performItemClick()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GridView.performItemClick()
方法的具体详情如下:
包路径:android.widget.GridView
类名称:GridView
方法名:performItemClick
暂无
代码示例来源:origin: qq8585083/DragIcon
@Override
public boolean performItemClick(View view, int position, long id) {
return super.performItemClick(view,
position + (mAdapter == null ? 0 : mAdapter.getHeaderViewsCount()), id);
}
代码示例来源:origin: AlexMofer/ProjectX
@Override
public boolean performItemClick(View view, int position, long id) {
return super.performItemClick(view,
position + (mAdapter == null ? 0 : mAdapter.getHeaderViewsCount()), id);
}
代码示例来源:origin: stackoverflow.com
@Test
public void shouldDisplayDetailActivityWhenAdapterClicked() throws Exception{
List<ImageNode> nodes = new ArrayList<ImageNode>();
ImageNode node = new ImageNode();
node.setId(36597698);
node.setContributorId("halfpoint");
node.setFileName("halfpoint150200457");
node.setFolder("halfpoint1502");
node.setDescription("halfpoint1502");
node.setMediaType("halfpoint1502");
node.setUrlThumb(URLHelper.buildThumbUrl(
node.getId(),
node.getContributorId(),
node.getFolder(),
node.getFileName(),
node.getDescription()));
node.setUrlFullSize(URLHelper.buildFullSizeUrl(node.getUrlThumb()));
nodes.add(node);
DetailLikeBoxAdapter mAdapter = new DetailLikeBoxAdapter(activity, nodes);
GridView gridView = (GridView) activity.findViewById(R.id.likebox_gridview);
gridView.setAdapter(mAdapter);
View itemView = mAdapter.getView(0, null, gridView);
gridView.performItemClick(itemView, 0, mAdapter.getItemId(0));
Intent startedIntent = shadowOf(activity).getNextStartedActivity();
ShadowIntent shadowIntent = shadowOf(startedIntent); // create shadow intent which starts next activity
System.out.println(DetailActivity.class.getName()+" "+shadowIntent.getComponent().getClassName() );
assertEquals(DetailActivity.class.getName(), shadowIntent.getComponent().getClassName()); // compare shadow intent w/ desired next activity
}
代码示例来源:origin: googlecodelabs/android-topeka
private void setUpUserInput() {
mAnswerView.performItemClick(mAnswerView.getChildAt(mAnswered), mAnswered,
mAnswerView.getAdapter().getItemId(mAnswered));
mAnswerView.getChildAt(mAnswered).setSelected(true);
mAnswerView.setSelection(mAnswered);
}
内容来源于网络,如有侵权,请联系作者删除!