码迷,mamicode.com
首页 > 其他好文 > 详细

sax

时间:2019-02-28 18:36:22      阅读:312      评论:0      收藏:0      [点我收藏+]

标签:div   string   att   sharp   XML   reader   etl   widget   try   

package com.cuthead.thishitler;

import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;

import org.xml.sax.SAXException;

import android.util.Xml;
import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;

public class MainActivity extends ListActivity {
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        String[] str = {"ycy","ljw"};
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_expandable_list_item_1,str);
		hitler hitler2 = new hitler();
		String str2 = "heil";
		Reader reader = new StringReader(new String(str2));
        try {
			Xml.parse(reader, hitler2);
		} catch (IOException e) {
		} catch (SAXException e) {
		}
        setListAdapter(adapter);
    }
    }

  

package com.cuthead.thishitler;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

	public class hitler extends DefaultHandler {
		public static final String TAG_UPDATED = "updated";
		public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
			if (TAG_UPDATED.equals(localName)) {
			}
		}

	}

  

sax

标签:div   string   att   sharp   XML   reader   etl   widget   try   

原文地址:https://www.cnblogs.com/cuthead/p/sax.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!