넣어 관련보기를 전송하는 데 사용의 getView를 다음과 같이 자신의 값을 설정할 수있는 위치 인의 getView() 메소드 hashMap의 메소드()를 호출합니다. getView의 첫 번째 매개 변수를 사용하여 listview의 선택된 항목의 위치를 가져올 수 있습니다. 경우 당신은 CustomListView을 구현해야한다 ("")
private List<HashMap<String, String>> myData = new ArrayList<HashMap<String, String>>();
public MyArrayAdapter(Context context, int textViewResourceId, List<HashMap<String, String>> objects)
{
super(context, textViewResourceId, objects);
try
{
context = getContext();
myData = objects;
}
catch (Exception e)
{
e.printStackTrace();
}
}
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
View v = convertView;
if(v == null)
{
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = inflater.inflate(R.layout.list_message_give_away_volunteers, null);
}
HashMap<String, String> hasValues = myData.get(position);
if(hasValues != null)
{
TextView txt_VolunteerName = (TextView)v.findViewById(R.id.txtVolunteerName);
txt_VolunteerName.setText(hasValues.get(DatabaseConstant.key_USER_NAME));
TextView txt_SkillLevel = (TextView)v.findViewById(R.id.txtSkillLevel);
txt_SkillLevel.setText(hasValues.get(DatabaseConstant.key_SKILL_LEVEL));
}
}
[기사] (http://www.vogella.de/articles/AndroidListView/article.html) 및 [또한 이쪽 (http://saigeethamn.blogspot.com/2010/04/)을 확인하십시오. custom-listview-android-developer.html) 인터넷에는 검색 만하면 더 많은 정보가 제공되며, 더 잘 찾을 수 있습니다. – MKJParekh
이봐 요,이 해결책을 찾을 수 있습니까 – HoangQBH