文件名称:android 解析xml
文件大小:726B
文件格式:XML
更新时间:2017-06-13 07:43:12
pullparser
package com.test;
import java.util.ArrayList;
import java.util.List;
import org.xmlpull.v1.XmlPullParser;
import com.test.webservice.WebService;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
public class MainActivity extends Activity {
/** Called when the activity is first created. */
private TextView text=null;
private Button Btn;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
text = (TextView)findViewById(R.id.TextView);
Btn = (Button) this.findViewById(R.id.yyy);
Btn.setOnClickListener(new OnClickListener(){
public void onClick(View arg0) {
try{
String name="";
String id="";
XmlPullParser pullParser = WebService.getXMLPullParser("soap.xml", null);
List