XPath xpath = XPathFactory.newInstance().newXPath();
String expression = "...";
EmParent = (Element) xpath.compile(expression).evaluate(Doc,XPathConstants.NODE);
Intent intent = new Intent(com.FSC.xml.MainActivity.this,com.FSC.xml.FileForm.class);
intent.putExtra("Em", EmParent)
startActivity(intent);
Asked
Active
Viewed 82 times
0

swiftBoy
- 35,607
- 26
- 136
- 135

Farhad Aghajanian
- 31
- 8
-
Please add more concrete description to the question – Volodymyr Nov 14 '16 at 14:40
-
Hi . In my app I read data from a xml file and I save this into element EmParent . Then I want pass EmParent to another activity and use it – Farhad Aghajanian Nov 14 '16 at 15:19
-
I dont know how can I do this – Farhad Aghajanian Nov 14 '16 at 15:21
-
How does your class EmParent look? Can you share this code? – Volodymyr Nov 14 '16 at 15:37
-
sorry but I read it as Element of DOOM and i cracked up.. carry on – David Andrei Ned Nov 14 '16 at 16:45
-
;-) ;-) yes its like it – Farhad Aghajanian Nov 14 '16 at 17:03
1 Answers
0
You can't pass nonParcelable or nonSerializable objects into the Intent
. Here is similar question.
But if you know structure of the EmParent
class
First, you can create a wrapper class which will extend Parcelable
or implement Serializable
and converter method which converts EmParent
into EmParentWrapper
and then pass it into intent
.
Second, is to put in the intent
data from you element by names(of course if you know it)
Intent intent = new Intent();
intent.putExtra("FirstAttr", element.getAttribute("FirstAttr"));
intent.putExtra("SecondAttr", element.getAttribute("SecondAttr"));