Created
September 23, 2015 07:34
-
-
Save orhanobut/e3585269ef8659a24398 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
public class Constants { | |
public static final String KEY_USER = "KEY_USER"; | |
} | |
// sends the data | |
public class LoginActivity extends Activity { | |
void displayHome() { | |
Intent intent = new Intent(this, HomeActivity.class); | |
intent.putExtra(Constants.KEY_USER, user); | |
startActivity(intent); | |
} | |
} | |
// gets the data | |
public class HomeActivity extends Activity { | |
@Override public void onCreate(Bundle bundle) { | |
String user = getIntent.getStringExtra(Constants.KEY_USER); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment