Earthquake Engineering (seismic monitoring)
This address: http://blog.csdn.net/caroline_wendy/article/details/24465487
earthquake Project address : http://blog.csdn.net/caroline_wendy/article/details/21976997
Because, the source address (Feed): Http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.atom Data Update ;
Therefore, when reading the title tag of the feed, a bug appears, such as title: <title>M 5.9-south of the Fiji Islands</ Title>
Data:
<entry><id>urn:earthquake-usgs-gov:us:b000py4w</id><title>m 5.9-south of the Fiji Islands </title><updated>2014-04-25t03:54:35.052z</updated><link rel= "Alternate" type= "text/html" href= "http://earthquake.usgs.gov/earthquakes/eventpage/usb000py4w"/><link rel= "alternate" type= " Application/cap+xml "href=" Http://earthquake.usgs.gov/earthquakes/eventpage/usb000py4w.cap "/><summary type = "html" ><! [Cdata[<p class= "quicksummary" ><a href= "http://earthquake.usgs.gov/earthquakes/eventpage/usb000py4w# Pager "title=" pager estimated impact alert level "class=" Pager-green ">pager-<strong class=" Roman ">green</ strong></a> <a href= "Http://earthquake.usgs.gov/earthquakes/eventpage/usb000py4w#shakemap" title= " Shakemap Maximum estimated intensity "class=" MMI-III ">shakemap-<strong class=" Roman ">III</strong> </a></p><dl><dt>time</dt><dd>2014-04-24 19:51:58 UTC</dd><dd>2014-04-24 07:51:58-12:00 at Epicenter</dd><dt>location</dt><dd>23.991°s 176.699°w</dd><dt>depth</dt><dd>63.53 km (39.48 mi) </dd></dl>]]></ Summary><georss:point>-23.9906-176.6986</georss:point><georss:elev>-63530</georss:elev ><category label= "Age" term= "Past day"/><category label= "Magnitude" term= "Magnitude 5"/></entry >
The title of this data does not include the last country, so the
comma (",") is omitted, resulting in the
Earthquakelistfragment.java class :
Details = Details.split (",") [1].trim ();
when
splitting (split) , no commas (",") are found, and only
one stringis used, and
an array is out of bounds when using
index 1 .
Error: "java.lang.arrayindexoutofboundsexception:length=1; Index=1"
Change to, change the comma (",") to Minus ("-"):
Details = Details.split ("-") [1].trim ();
That
location information includes "region, country".
Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.
Android-earthquake Engineering (seismic monitoring)