i begginner android , want develop something. have question using more 1 activity. create 2 activity , invoke others intent. use code part :
intent intent = new intent(mainscreen.this,getnearestplaceactivity.class); startactivity(intent); and calls other runtime error after invoking second activity(application has sstopped unexpectedly). second activity dummy tried achieve intent. code sample second activity :
public class getnearestplaceactivity extends activity {
public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); // setcontentview(r.layout.main); } } is problem using same layout xml file? have use different xml file every activity?
the log tell more info (either run adb logcat commandline, or @ logcat tab in eclipse). did remember add new activity manifest file? every activity needs declared in androidmanifest.xml file.
and no, don't need separate layout xml files each activity, can share layouts if want.
Comments
Post a Comment