I am trying to parse XML and display it into list view, but after running the app nothing happens -- the list is displayed but not with the XML data . I don\'t know if I am
You cannot directly change or reference your String
object to Integer
type because there is no parent-child
relationship between these two classes.
If you try to cast
a String
to a Integer
in such a way, it will raise a ClassCastException
.
String someValue = "123";
Integer intValue = (Integer) someValue; // ClassCastException Raise.
So if you want to change or reference a String
Variable to Integer
, you must use parsing techniques.
int intValue = Integer.parseInt(someValue); //this code will work for this.