我问的问题可能已经被问过了,但我被卡住了。我想将数据从EditText
一个活动传递到ListView
另一个活动我该怎么做。我使用了意图putExtra
,但我无法实现 get 函数,所以任何人都可以告诉我如何实现 get 函数ListView
。
private static class ListViewAdapter extends BaseAdapter{
private LayoutInflater Linflate;
private Object convertView;
public ListViewAdapter(Context context)
{
Linflate=LayoutInflater.from(context);
}
@Override
public int getCount() {
// TODO Auto-generated method stub
return ListViewContent.size();
}
@Override
public Object getItem(int arg0) {
// TODO Auto-generated method stub
return null;
}
@Override
public long getItemId(int arg0) {
// TODO Auto-generated method stub
return 0;
}
@Override
public View getView(int position, View v, ViewGroup arg2) {
final ListContent holder;
if (v== null) {
v = Linflate.inflate(R.layout.listviewinflator, null);
holder = new ListContent();
holder.text = (TextView) v.findViewById(R.id.TextView01);
holder.text.setCompoundDrawables(v.getResources().getDrawable(R.drawable.ic_launcher), null, null, null);
v.setTag(holder);
} else {
holder = (ListContent)v.getTag();
}
holder.text.setText(ListViewContent.get(position));
return v;
}
static class ListContent {
TextView text;
}
}
private static final ArrayList<String> ListViewContent = new ArrayList<String>();
}
在这个我想设置get方法。