Android 在列表项处于排序位置后修复listview的项
尝试创建排序列表视图时,当特定项位于其排序位置时,我希望修复它,即我希望禁用该特定项 我试过的也是我试过的[在这里输入链接描述][1]有人能解释我错在哪里吗 [1] :、my getview和myonitemclicklistener是Android 在列表项处于排序位置后修复listview的项,android,listview,Android,Listview,尝试创建排序列表视图时,当特定项位于其排序位置时,我希望修复它,即我希望禁用该特定项 我试过的也是我试过的[在这里输入链接描述][1]有人能解释我错在哪里吗 [1] :、my getview和myonitemclicklistener是 @Override public View getView(int position, View convertView, ViewGroup parent) { View view = convertView; boolean isC
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = convertView;
boolean isConverted = true;
if (view == null) {
Log.v("talkinginterval", "create view " + position);
view = mInflater.inflate(mViewResourceId, parent, false);
isConverted = false;
}
modifyView(position, view, isConverted);
for (int i = 0; i < mTo.length; i++) {
View v = view.findViewById(mTo[i]);
String from = mFrom[i];
String data = mDataProvider.getItem(position);
Long strId =mDataProvider.getItemId(position);
Log.d("AstrId", "strId="+strId);
Log.d("A", "mDataProvider.getItem(position)="+mDataProvider.getItem(position));
String d = data.toString();
myList.put(position, strId);
boolean bound = false;
if (mViewBinder != null) {
bound = mViewBinder.setViewValue(view, v, d, from);
}
if (!bound) {
if (v instanceof TextView) {
((TextView) v).setText(d);
} else {
throw new IllegalStateException(v.getClass().getName() + " is not a "
+ " view that can be bounds by this Adapter");
}
}
and
mylist.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View view, int pos,
long id) {
// TODO Auto-generated method stub
TextView c = (TextView) view.findViewById(R.id.textView1);
String playerChanged = c.getText().toString();
Log.d("A", "" + "Item clicklistener" + pos);
mDraggableListView.setDragStatus(true);
if (pos == 0) {
Log.d("A0", "" + "Item clicklistener" + pos);
// mDraggableListView.setDragStatus(false);
}/*
* else{ mDraggableListView.setDragStatus(true); }
*/
Long myid = GenericAdapter.myList.get(pos);
Log.d("Afinal", "myid"+myid);
}
});
@覆盖
公共视图getView(int位置、视图转换视图、视图组父视图){
视图=转换视图;
布尔值isConverted=true;
如果(视图==null){
Log.v(“通话间隔”,“创建视图”+位置);
view=mInflater.inflate(mViewResourceId,父项,false);
isConverted=false;
}
修改视图(位置、视图、转换);
对于(int i=0;i
和public static HashMap myList=new HashMap();是我的吗?你的问题很模糊。请在人们投票关闭它之前说清楚。