android - how to use xml with intents? -
i'm writing application want able launch second class different layout when menu button pressed. code have switch classes is:
case menubutton1: intent = new intent(budgeter.this, outgoings.class); startactivity(i); return true;
(obviously within case statement)
how create xml file relates second class? need edit androidmanifest.xml?
finally if point me towards tutorials on intents appreciate it.
i'm guessing here you're confused thinking layout file activity has called main.xml??? if so, not case...
you can have budgeter.xml
, outgoings.xml
etc etc.
just use setcontentview(r.layout.budgeter)
in budgeter activity's oncreate(...)
method , setcontentview(r.layout.outgoings)
in outgoings activity oncreate(...)
, on.
also need edit androidmanifest.xml?
yes, activities must registered in androidmanifest.xml
as working intents, try starter...
Comments
Post a Comment