Back to project page android_tutorial_projects.
The source code is released under:
Copyright (c) 2013, Uthcode All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redi...
If you think the Android project android_tutorial_projects listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.uthcode.intents; /* w ww . ja va2 s . c o m*/ import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.widget.EditText; import android.widget.TextView; public class ResultActivity extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle extras = getIntent().getExtras(); String data = extras.getString("data"); setContentView(R.layout.activity_result); TextView view = (TextView) findViewById(R.id.displayintentextra); view.setText(data); } @Override public void finish() { Intent intent = new Intent(); EditText et = (EditText) findViewById(R.id.returnValue); String result = et.getText().toString(); intent.putExtra("result", result); setResult(RESULT_OK, intent); super.finish(); } }