Last active
August 29, 2015 14:03
-
-
Save gmsetiawan/71619f3037a10df40d76 to your computer and use it in GitHub Desktop.
This file contains hidden or 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.content.Intent; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.Button; | |
import android.widget.EditText; | |
public class MainActivity extends Activity { | |
EditText edSent; | |
Button btnSent; | |
String note; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_one); | |
edSent = (EditText) findViewById(R.id.editText1); | |
btnSent = (Button) findViewById(R.id.button1); | |
btnSent.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
// TODO Auto-generated method stub | |
note = edSent.getText().toString(); | |
Intent intent = new Intent(MainActivity.this, ActivityTwo.class); | |
intent.putExtra("keyName", note); // pass your values and retrieve them in the other Activity using keyName | |
startActivity(intent); | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment