Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2013
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.47 KB | None | 0 0
  1. Description Resource Path Location Type
  2. R cannot be resolved to a variable screen1.java /screen1/src/test/android line 20 Java Problem
  3. R cannot be resolved to a variable screen1.java /screen1/src/test/android line 21 Java Problem
  4. R cannot be resolved to a variable screen2.java /screen1/src/test/android line 13 Java Problem
  5. R cannot be resolved to a variable screen2.java /screen1/src/test/android line 14 Java Problem
  6. Unparsed aapt error(s)! Check the console for output. screen1 line 1 Android ADT Problem
  7.  
  8. package test.android;
  9.  
  10.  
  11. import android.app.Activity;
  12. import android.content.Intent;
  13. import android.os.Bundle;
  14. import android.view.View;
  15. import android.widget.Button;
  16.  
  17.  
  18.  
  19.  
  20. public class screen1 extends Activity
  21. {
  22. public void onCreate(Bundle icicle)
  23. {
  24. super.onCreate(icicle);
  25. setContentView(R.layout.screen1);
  26. Button b = (Button)findViewById(R.id.btnClick);
  27. b.setOnClickListener(new View.OnClickListener() {
  28. public void onClick(View arg0) {
  29. Intent i = new Intent(screen1.this, screen2.class);
  30. startActivity(i);
  31. }
  32. });
  33. }
  34. }
  35.  
  36. package test.android;
  37.  
  38. import android.app.Activity;
  39. import android.os.Bundle;
  40. import android.view.View;
  41. import android.widget.Button;
  42.  
  43. public class screen2 extends Activity
  44. {
  45. public void onCreate(Bundle icicle)
  46. {
  47. super.onCreate(icicle);
  48. setContentView(R.layout.screen2);
  49. Button b = (Button) findViewById(R.id.btnClick2);
  50. b.setOnClickListener(new View.OnClickListener() {
  51. public void onClick(View arg0) {
  52. setResult(RESULT_OK);
  53. finish();
  54. }
  55. });
  56. }
  57. }
  58.  
  59. <?xml version="1.0" encoding="utf-8"?>
  60. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  61. package="test.android"
  62. android:versionCode="1"
  63. android:versionName="1.0">
  64.  
  65.  
  66. <application android:icon="@drawable/icon" android:label="@string/app_name">
  67. <activity android:name=".Screen1" android:label="Screen 1">
  68. <activity android:name=".screen1"
  69. android:label="@string/app_name">
  70. <intent-filter>
  71. <action android:name="android.intent.action.MAIN" />
  72. <category android:name="android.intent.category.LAUNCHER" />
  73. </intent-filter>
  74. </activity>
  75. </activity>
  76. <activity android:name=".Screen2" android:label="Screen 2">
  77. </activity>
  78.  
  79. </application>
  80. </manifest>
  81.  
  82. <?xml version="1.0" encoding="utf-8"?>
  83. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  84. android:orientation="vertical"
  85. android:layout_width="fill_parent"
  86. android:layout_height="fill_parent"
  87. >
  88. <TextView
  89. android:layout_width="fill_parent"
  90. android:layout_height="wrap_content"
  91. android:text="You are in the first Screen"
  92. />
  93. <Button
  94. android:id ="@+id/btnClick"
  95. android:layout_width="wrap_content"
  96. android:layout_height="wrap_content"
  97. android:text="Open New Screen"
  98. />
  99.  
  100. </LinearLayout>
  101.  
  102. <?xml version="1.0" encoding="utf-8"?>
  103. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  104. android:orientation="vertical"
  105. android:layout_width="fill_parent"
  106. android:layout_height="fill_parent"
  107. >
  108. <TextView
  109. android:layout_width="fill_parent"
  110. android:layout_height="wrap_content"
  111. android:text="You are in the New Screen"
  112. />
  113. <Button
  114. android:id ="@+id/btnClick2"
  115. android:layout_width="wrap_content"
  116. android:layout_height="wrap_content"
  117. android:text="Close"
  118. />
  119.  
  120. </LinearLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement