Hi am newbie to java and android.
Assume function demo() from the screenone is going to display some values on Textview which is on the same screen(screenone).
But i need to display that resultant value to the next screen ie.(screen two)
public void demo(){
{
.....
.....
}
So i have included these line to
screenoneActivity.java
Intent nextScreen = new Intent(getApplicationContext(), SecondtwoActivity.class);
nextScreen.putExtra("","");
startActivity(nextScreen);
demo();
ScreentwoActivity.java
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main1);
TextView txtName = (TextView) findViewById(R.id.textView1);
Intent i = getIntent();
txtName.setText(name);
I did these things so far.I don’t know how to do transfer data from demo() function to the next screen.
Can anyone give me clues or ideas to achieve this.
Thanks a lot!..
You need to send some value into the putExtra methods parameters to be able to get something out of it.
In your first activity(A):
In your second activity(B):