how to redirect from Normal java class to other java class which extends activity in android? -
how redirect normal java class other java class extends activity in android putting data.
to start activity class
intent = new intent(this, activitytwo.class);//this current class startactivity(i);
to pass value in class 1
intent = new intent(this, activitytwo.class); i.putextra("value1", "this value 1 activitytwo "); i.putextra("value2", "this value 2 activitytwo");
to values .from activitytwo.class
bundle extras = getintent().getextras(); if (extras == null) { return; } // data via key string value1 = extras.getstring(intent.extra_text); if (value1 != null) { // data }
Comments
Post a Comment