Last active
September 23, 2015 07:33
-
-
Save orhanobut/26d1d7142057ba5f90b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sends the data | |
public class LoginActivity extends Activity { | |
void displayHome() { | |
Intent intent = new Intent(this, HomeActivity.class); | |
intent.putExtra(HomeActivity.KEY_USER, user); | |
startActivity(intent); | |
} | |
} | |
// gets the data | |
public class HomeActivity extends Activity { | |
public static final String KEY_USER = "KEY_USER"; | |
@Override public void onCreate(Bundle bundle) { | |
String user = getIntent.getStringExtra(KEY_USER); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment