android - Read each of elements in XML file when clicking on an item in popup menu -
i have xml file below:
<?xml version="1.0" encoding="utf-8"?> <engine> <engine1 engine1="engine1"> <cylinder cylinder="cylinder1" bp="0.01" p="0.02" t="0.04" ></cylinder> <cylinder cylinder="cylinder2" bp="0.01" p="0.02" t="0.04" ></cylinder> <cylinder cylinder="cylinder3" bp="0.01" p="0.02" t="0.04" ></cylinder> </engine1> <engine2 engine2="engine2"> <cylinder cylinder="cylinder1" bp="0.01" p="0.02" t="0.04" ></cylinder> <cylinder cylinder="cylinder2" bp="0.01" p="0.02" t="0.04" ></cylinder> <cylinder cylinder="cylinder3" bp="0.01" p="0.02" t="0.04" ></cylinder> </engine2> </engine>
i'm intending create popup menu presented list of engines (i.e. engine 1, engine 2,etc.). when clicking on 1 of engines in popup menu, shows specifications related engine in xml file (i.e. click on engine 1 in menu popup, specifications related engine 1 showed, corresponding other engines).
i have used menus represent popup menu. however, i don't know how read each of engine in xml file when click on "engine" in popup menu. tried use "switch-case" this, not successful because our number of engine , cylinder dynamic (not static 3 engines).
can guys me this? thank guys much!
Comments
Post a Comment