android - parse names to a listview with XMLPullParser -


i went many sites learn how use xmlpullparser still confuse in head..

i have xml :

<campagne>     <sms>        <texte>vente drouot</texte>            <list>                <id> 1 </id>                     <nom> toto </nom>                <id> 2 </id>                     <nom> tata </nom>               <id> 3 </id>                     <nom> mr.gerard </nom>            </list>    </sms> </campagne> 

so have mainactivity button "get xml". when click button goes second activity listview , edittext. in edittext managed text in node "texte" (vente drouot), want names in nodes "nom" insert them listview...

for have :

public void parsexmlandstoreit(xmlpullparser myparser) {         int event;         string text = null;         try {             event = myparser.geteventtype();             while (event != xmlpullparser.end_document) {                 string name = myparser.getname();                 switch (event) {                 case xmlpullparser.start_tag:                     break;                 case xmlpullparser.text:                     text = myparser.gettext();                     break;                  case xmlpullparser.end_tag:                     if (name.equals("texte")) {                         message = text;                     } else {                     }                     break;                 }                 event = myparser.next();              }             parsingcomplete = false;         } catch (exception e) {             e.printstacktrace();         }      } 

anyone can give me little please ? thank you


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -