diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-02-12 22:33:14 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-11-10 17:40:54 +0100 |
commit | ee3ef2bcf3656e3e7a02d86d43858cc8145508da (patch) | |
tree | c428969d47180877913f95201067f4b750f91b2a /Android/02-Intents/MyBrowser/src/course/labs/intentslab/MyBrowserActivity.java | |
parent | 339c57d3520c8de6f970b020c87f77ec266f3bf8 (diff) | |
download | coursera-ee3ef2bcf3656e3e7a02d86d43858cc8145508da.zip coursera-ee3ef2bcf3656e3e7a02d86d43858cc8145508da.tar.gz |
Android : 02-Intents: add
Diffstat (limited to 'Android/02-Intents/MyBrowser/src/course/labs/intentslab/MyBrowserActivity.java')
-rw-r--r-- | Android/02-Intents/MyBrowser/src/course/labs/intentslab/MyBrowserActivity.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Android/02-Intents/MyBrowser/src/course/labs/intentslab/MyBrowserActivity.java b/Android/02-Intents/MyBrowser/src/course/labs/intentslab/MyBrowserActivity.java new file mode 100644 index 0000000..e165ea2 --- /dev/null +++ b/Android/02-Intents/MyBrowser/src/course/labs/intentslab/MyBrowserActivity.java @@ -0,0 +1,24 @@ +package course.labs.intentslab.mybrowser; + +import android.app.Activity; +import android.os.Bundle; +import android.widget.TextView; + +public class MyBrowserActivity extends Activity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.my_browser_activity); + + // Save the String passed with the intent + String url = getIntent().getDataString(); + + if (null == url) + url = "No Data Provided"; + + // Get a reference to the TextView and set the text it to the String + TextView textView = (TextView) findViewById(R.id.url); + textView.setText(url); + } +} |