0
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);
swiftBoy
  • 35,607
  • 26
  • 136
  • 135

1 Answers1

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"));
Community
  • 1
  • 1
Volodymyr
  • 6,393
  • 4
  • 53
  • 84