Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. package com.example.smartbrowser;
  2.  
  3. import android.os.Bundle;
  4.  
  5. import android.app.Activity;
  6.  
  7. import android.content.Intent;
  8.  
  9. import android.view.Menu;
  10.  
  11. import android.widget.TextView;
  12.  
  13. public class MainActivity extends Activity {
  14.  
  15.  
  16. @Override
  17.  
  18. protected void onCreate(Bundle savedInstanceState) {
  19.  
  20. super.onCreate(savedInstanceState);
  21.  
  22. TextView vw =(TextView) findViewById(R.id.text);
  23.  
  24. Intent intent =getIntent();
  25.  
  26. String message = intent.getStringExtra(Browseractivity.Message);
  27.  
  28.  
  29. vw.setText(message);
  30.  
  31.  
  32. setContentView(R.layout.activity_main);
  33. }
  34.  
  35.  
  36. }
  37.  
  38. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  39.  
  40. xmlns:tools="http://schemas.android.com/tools"
  41.  
  42. android:layout_width="match_parent"
  43.  
  44. android:layout_height="match_parent"
  45.  
  46. android:paddingBottom="@dimen/activity_vertical_margin"
  47.  
  48. android:paddingLeft="@dimen/activity_horizontal_margin"
  49.  
  50. android:paddingRight="@dimen/activity_horizontal_margin"
  51.  
  52. android:paddingTop="@dimen/activity_vertical_margin"
  53.  
  54. tools:context=".MainActivity" >
  55.  
  56.  
  57. <TextView
  58.  
  59. android:id="@+id/text"
  60.  
  61. android:layout_width="wrap_content"
  62.  
  63. android:layout_height="wrap_content"
  64.  
  65. android:layout_alignParentLeft="true"
  66.  
  67. android:layout_alignParentTop="true"
  68.  
  69.  
  70. />
  71.  
  72.  
  73. </RelativeLayout>
  74.  
  75. @Override
  76.  
  77. protected void onCreate(Bundle savedInstanceState) {
  78.  
  79.  
  80. super.onCreate(savedInstanceState);
  81. setContentView(R.layout.activity_main);
  82.  
  83. TextView vw =(TextView) findViewById(R.id.text);
  84.  
  85. Intent intent =getIntent();
  86.  
  87. String message = intent.getStringExtra(Browseractivity.Message);
  88.  
  89.  
  90. vw.setText(message);
  91.  
  92.  
  93.  
  94. }
  95.  
  96.  
  97. }
  98.  
  99. @Override
  100. protected void onCreate(Bundle savedInstanceState) {
  101. super.onCreate(savedInstanceState);
  102. setContentView(R.layout.activity_main); // should be first
  103. TextView vw =(TextView) findViewById(R.id.text); // then initialize textview
  104. Intent intent =getIntent();
  105. String message = intent.getStringExtra(Browseractivity.Message);
  106. vw.setText(message);
  107. }
  108.  
  109. @Override
  110. protected void onCreate(Bundle savedInstanceState) {
  111.  
  112. super.onCreate(savedInstanceState);
  113. setContentView(R.layout.activity_main);
  114.  
  115. TextView vw =(TextView) findViewById(R.id.text);
  116.  
  117. Intent intent =getIntent();
  118.  
  119. String message = intent.getStringExtra(Browseractivity.Message);
  120. vw.setText(message);
  121. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement