简体   繁体   中英

How to parse XML in android with the url image and text and frame it in a List view

Can any one tell me how to parse an XML file which has a url of the image and also two text and i have to parse and display it in the list view. Can any one please show me with coding, as am a beginner and i want to do this task. This is not static but dynamic in which iwill have the url and i just have to parse that from my android application and display it in List View. Thanks in advance. If anyone could help me in this.

Depends on the type of adapter you're using. If you're using a built in adapter, it should take a layout resource id. If you're building your own, use this:

public View getView(int position, View convertView, ViewGroup parent) {
        View v = convertView;
        if (v == null) {
            LayoutInflater vi = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            v = vi.inflate(R.layout.call_list_view, null);
        }
            //initialize the view values here
  }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM