android.widget.ListView.getItemAtPosition()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(642)

本文整理了Java中android.widget.ListView.getItemAtPosition()方法的一些代码示例,展示了ListView.getItemAtPosition()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ListView.getItemAtPosition()方法的具体详情如下:
包路径:android.widget.ListView
类名称:ListView
方法名:getItemAtPosition

ListView.getItemAtPosition介绍

暂无

代码示例

代码示例来源:origin: daniulive/SmarterStreaming

@SuppressWarnings("unchecked")  
    @Override
  public  void onItemClick(AdapterView<?> parent, View view,  int position, long id) 
    {  
      ListView listView = (ListView)parent;  
      HashMap<String, String> map = (HashMap<String, String>) listView.getItemAtPosition(position);  
      String fileName = map.get("ItemFileName");  
      PlayRecFile(fileName);
    }  
});

代码示例来源:origin: daniulive/SmarterStreaming

@SuppressWarnings("unchecked")
  @Override
  public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    ListView listView = (ListView) parent;
    HashMap<String, String> map = (HashMap<String, String>) listView.getItemAtPosition(position);
    String fileName = map.get("ItemFileName");
    PlayRecFile(fileName);
  }
});

代码示例来源:origin: daniulive/SmarterStreaming

@SuppressWarnings("unchecked")  
    @Override
  public  void onItemClick(AdapterView<?> parent, View view,  int position, long id) 
    {  
      ListView listView = (ListView)parent;  
      HashMap<String, String> map = (HashMap<String, String>) listView.getItemAtPosition(position);  
      String fileName = map.get("ItemFileName");  
      PlayRecFile(fileName);
    }  
});

代码示例来源:origin: daniulive/SmarterStreaming

@SuppressWarnings("unchecked")
  @Override
  public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    ListView listView = (ListView) parent;
    HashMap<String, String> map = (HashMap<String, String>) listView.getItemAtPosition(position);
    String fileName = map.get("ItemFileName");
    PlayRecFile(fileName);
  }
});

代码示例来源:origin: alibaba/Tangram-Android

@Override
  protected void onListItemClick(ListView l, View v, int position, long id) {
    Map<String, String> item = (Map<String, String>)l.getItemAtPosition(position);
    String className = item.get("class");
    if (className != null) {
      Intent intent = new Intent();
      intent.setComponent(new ComponentName(this, className));
      startActivity(intent);
    }
  }
}

代码示例来源:origin: stackoverflow.com

ListView list = getListView();
int start = list.getFirstVisiblePosition();
for(int i=start, j=list.getLastVisiblePosition();i<=j;i++)
  if(target==list.getItemAtPosition(i)){
    View view = list.getChildAt(i-start);
    list.getAdapter().getView(i, view, list);
    break;
  }

代码示例来源:origin: stackoverflow.com

ListView list = getListView();
int start = list.getFirstVisiblePosition();
for(int i=start, j=list.getLastVisiblePosition();i<=j;i++)
  if(target==list.getItemAtPosition(i)){
    View view = list.getChildAt(i-start);
    list.getAdapter().getView(i, view, list);
    break;
  }

代码示例来源:origin: xfumihiro/ViewInspector

@Override public void onClick(DialogInterface dialog, int which) {
  restoreOpenedMenu();
  listener.onViewRootSelected(
    (View) listView.getItemAtPosition(listView.getCheckedItemPosition()));
 }
});

代码示例来源:origin: facebook/facebook-android-sdk

private void onListItemClick(ListView listView, View v, int position) {
  @SuppressWarnings("unchecked")
  JSONObject graphObject = (JSONObject) listView.getItemAtPosition(position);
  String id = adapter.getIdOfGraphObject(graphObject);
  selectionStrategy.toggleSelection(id);
  adapter.notifyDataSetChanged();
  if (onSelectionChangedListener != null) {
    onSelectionChangedListener.onSelectionChanged(PickerFragment.this);
  }
}

代码示例来源:origin: 4thline/cling

@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
  AlertDialog dialog = new AlertDialog.Builder(this).create();
  dialog.setTitle(R.string.deviceDetails);
  DeviceDisplay deviceDisplay = (DeviceDisplay)l.getItemAtPosition(position);
  dialog.setMessage(deviceDisplay.getDetailsMessage());
  dialog.setButton(
    getString(R.string.OK),
    new DialogInterface.OnClickListener() {
      public void onClick(DialogInterface dialog, int which) {
      }
    }
  );
  dialog.show();
  TextView textView = (TextView) dialog.findViewById(android.R.id.message);
  textView.setTextSize(12);
  super.onListItemClick(l, v, position, id);
}

代码示例来源:origin: k9mail/k-9

Cursor cursor = (Cursor) listView.getItemAtPosition(info.position);

代码示例来源:origin: k9mail/k-9

selectedContextAccount = (BaseAccount)getListView().getItemAtPosition(menuInfo.position);

代码示例来源:origin: stackoverflow.com

int position, long id) {
Object o = list1.getItemAtPosition(position);
String pen = o.toString();
Toast.makeText(getApplicationContext(), "You have chosen the pen: " + " " + pen, Toast.LENGTH_LONG).show();

代码示例来源:origin: fossasia/pslab-android

@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
  String itemValue = (String) lvSensor.getItemAtPosition(position);
  Intent intent;
  switch (itemValue) {

代码示例来源:origin: ai212983/android-spinnerwheel

@Override
  protected void onListItemClick(ListView l, View v, int position, long id) {
    Map map = (Map) l.getItemAtPosition(position);

    Intent intent = (Intent) map.get("intent");
    startActivity(intent);
  }
}

代码示例来源:origin: huangfangyi/FanXin

@Override
  public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    EaseUser user = (EaseUser)listView.getItemAtPosition(position);
    listItemClickListener.onListItemClicked(user);
  }
});

代码示例来源:origin: yixia/VitamioBundleStudio

@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
  @SuppressWarnings("unchecked")
Map<String, Object> map = (Map<String, Object>) l.getItemAtPosition(position);
  Intent intent = (Intent) map.get("intent");
  startActivity(intent);
}

代码示例来源:origin: yixia/VitamioBundleStudio

@SuppressWarnings("unchecked")
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
  Map<String, Object> map = (Map<String, Object>) l.getItemAtPosition(position);
  Intent intent = (Intent) map.get("intent");
  startActivity(intent);
}

代码示例来源:origin: huangfangyi/FanXin

@Override
  public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    try {
      EaseUser user = ((EaseUser) listView.getItemAtPosition(position));
      if (user != null && user.getUserInfo() != null) {
        startActivity(new Intent(getActivity(), UserDetailsActivity.class).putExtra(FXConstant.KEY_USER_INFO, user.getUserInfo()));
      }
    } catch (NullPointerException e) {
      e.printStackTrace();
    }
  }
});

代码示例来源:origin: Coinomi/coinomi-android

@OnItemClick(R.id.coins_list)
void editFee(int currentSelection) {
  Value fee = (Value) coinList.getItemAtPosition(currentSelection);
  // Create the fragment and show it as a dialog.
  DialogFragment editFeeDialog = EditFeeDialog.newInstance(fee.type);
  editFeeDialog.show(getFragmentManager(), EDIT_FEE_DIALOG);
}

相关文章

ListView类方法