java - startActivity not working in android -
i have not been able find solution problem works, here is:
when play code debugger shows startactivity statement reached, execution passes on it.
java code:
public class grassesdofamily extends appcompatactivity { protected string tag = "grassesdofamily >>"; private string familyname; private string familytext; private int familynumber; private string familytable; private int genusnumber; private int speciesnumber; context dcontext = grassesdofamily.this; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.grasses_layout_start_family); getsupportactionbar().setdisplayshowhomeenabled(true); intent myintent = getintent(); familynumber = myintent.getintextra("familynumber", 0); genusnumber = myintent.getintextra("genusnumber", 0); speciesnumber = myintent.getintextra("speciesnumber", 0); /** * family data */ getfamily(familynumber); /** * special case fam=5 : generic, fam=4 plantaginaceae */ // intent intentgrassesshowspeciesmain = new intent(dcontext, grassesshowspeciesmain.class); intent intentgrassesshowspeciesmain = new intent(dcontext, grassesshowspeciesmain.class); /** * genus# , species# if not plantaginaceae */ if (familynumber==5){ intentgrassesshowspeciesmain.putextra("genusnumber", genusnumber); intentgrassesshowspeciesmain.putextra("speciesnumber", speciesnumber); } if ((familynumber==5) || (familynumber==4)){ intentgrassesshowspeciesmain.putextra("familynumber", familynumber); startactivity(intentgrassesshowspeciesmain); }
manifest:
<activity android:name="com.learningideas.grasses.grassesshowspeciesmain" android:icon="@mipmap/ic_launcher" android:theme="@style/customactionbartheme" android:configchanges="orientation|keyboardhidden|screensize" android:label="@string/doshowspecies" android:screenorientation="portrait" android:parentactivityname="com.learningideas.grasses.grassesactivitymain"> <meta-data android:name="android.support.parent_activity" android:value="com.learningideas.grasses.grassesactivitymain" /> </activity>
help appreciated.
i think problem might odd context member variable using. try simplifying to:
intent intentgrassesshowspeciesmain = new intent(this,grassesshowspeciesmain.class);
Comments
Post a Comment