xml - how to force android to read newst file from server? -


in app read xml online using following code , works fine:

url url = new url("http://dl.1kolbe.ir/adv.xml"); documentbuilderfactory dbf = documentbuilderfactory.newinstance(); documentbuilder db = dbf.newdocumentbuilder(); document doc = db.parse(new inputsource(url.openstream())); doc.getdocumentelement().normalize(); nodelist nl = doc.getelementsbytagname("item");  node node = nl.item(i); element fstelmnt = (element) node; nodelist namelist = fstelmnt.getelementsbytagname("title"); element nameelement = (element) namelist.item(0); namelist = nameelement.getchildnodes(); final string adv_title = ((node) namelist.item(0)).getnodevalue(); 

but when change xml data on server, app display old xml data. think have clear cache, don't know how!

i find trick solve it! add random , unused argument url, android think of new url:

time = new time(); now.settonow(); string time = "" + now.hour + now.minute + now.second; int time_int = integer.parseint(time); url url = new url("http://dl.1kolbe.ir/adv.xml" + "?unused=" + time_int); 

Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -