开发学院手机开发Android 开发 Android 快速实现一个文件选择器 阅读

Android 快速实现一个文件选择器

 2010-02-24 04:48:00 来源:WEB开发网   
核心提示:}public View getView(int arg0, View arg1, ViewGroup arg2) {// TODO Auto-generated method stub//LinearLayout layout=null ;LayoutInflater inflate = (LayoutInflate

}

public View getView(int arg0, View arg1, ViewGroup arg2) {

// TODO Auto-generated method stub

//LinearLayout layout=null ;

LayoutInflater inflate = (LayoutInflater) mContext.getSystemService(android.content.Context.LAYOUT_INFLATER_SERVICE);

arg1 = (LinearLayout) inflate.inflate(R.layout.listfile,null);

TextView fm_text_01= (TextView)arg1.findViewById(R.id.fm_text_01);

fm_text_01.setText(getItem(arg0).name);

//Log.v("vodone",""+arg0+" name="+getItem(arg0).name);

/*if (getItem(arg0).equals(".")){

}*/

return arg1 ;

}

}

private class ExpBaseAdapter extends BaseAdapter {

private Context mContext;

private Vector mItems = new Vector();

private LinearLayout layout,layout_more;

public ExpBaseAdapter(Context context) {

mContext = context;

}

public void addItem(fileData it) {

mItems.add(it);

}

public fileData getItem(int it) {

return (fileData)mItems.elementAt(it);

}

public int getCount() {

// TODO Auto-generated method stub

return mItems.size();

}

public long getItemId(int arg0) {

// TODO Auto-generated method stub

return arg0;

}

public int getItemType(int arg0) {

// TODO Auto-generated method stub

return getItem(arg0).type;

}

public void clearItems(){

mItems.clear();

}

public View getView(int arg0, View arg1, ViewGroup arg2) {

// TODO Auto-generated method stub

//LinearLayout layout=null ;

LayoutInflater inflate = (LayoutInflater) mContext.getSystemService(android.content.Context.LAYOUT_INFLATER_SERVICE);

arg1 = (LinearLayout) inflate.inflate(R.layout.listfile,null);

上一页  1 2 3 4 5  下一页

Tags:Android 快速 实现

编辑录入:coldstar [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
赞助商链接