Last active
August 29, 2015 14:03
-
-
Save gmsetiawan/e7b314e03e671bb9753e 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
package com.example.droidclass; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.widget.TextView; | |
public class ActivityTwo extends Activity { | |
TextView tvReceived; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_two); | |
tvReceived = (TextView) findViewById(R.id.textView1); | |
String data = getIntent().getExtras().getString("sentNote"); | |
tvReceived.setText(data); | |
} | |
//Option 1 | |
/*Bundle extras = intent.getExtras(); | |
if(extras != null) | |
String data = extras.getString("keyName");*/ | |
//Option 2 | |
//Shortest way to received | |
//String data = getIntent().getExtras().getString("keyName"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment