Android New Intent New Screen -
i still not sure of opening new screen new intent. have 2 problems. 1 getting work , second more theory.
firstly have 2 packages com.quiz.max , com.reason.max both have activities names accordingly eg quiz , reason respectively. here on click code trying execute @ moment in quiz go reason.
intent intent = new intent(); intent.setclassname("com.reason.max", "com.reason.max.reason"); this.startactivityforresult(intent, requestcode);
secondly heard if start intent everytime click button new intent created. mean if user goes reason page , navigates , clicks button again create new intent instead of going active one. dozens opened via method. therefore should close each reason intent once navigated or redundant point?
max
i think want
intent intent = new intent(this, reason.class); startactivityforresult(intent, requestcode);
secondly, don't "start intent". use intent ask activity
start, in case reason
activity. , yes, default behavior start new instance of activity each time requested.
you can alter behavior launchmode.
make sure read , understand activity lifecycle. don't need worry many activities in existence, android handle you, should save state , clean connections in appropriate lifecycle methods.
Comments
Post a Comment