Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Description Resource Path Location Type
- R cannot be resolved to a variable screen1.java /screen1/src/test/android line 20 Java Problem
- R cannot be resolved to a variable screen1.java /screen1/src/test/android line 21 Java Problem
- R cannot be resolved to a variable screen2.java /screen1/src/test/android line 13 Java Problem
- R cannot be resolved to a variable screen2.java /screen1/src/test/android line 14 Java Problem
- Unparsed aapt error(s)! Check the console for output. screen1 line 1 Android ADT Problem
- package test.android;
- import android.app.Activity;
- import android.content.Intent;
- import android.os.Bundle;
- import android.view.View;
- import android.widget.Button;
- public class screen1 extends Activity
- {
- public void onCreate(Bundle icicle)
- {
- super.onCreate(icicle);
- setContentView(R.layout.screen1);
- Button b = (Button)findViewById(R.id.btnClick);
- b.setOnClickListener(new View.OnClickListener() {
- public void onClick(View arg0) {
- Intent i = new Intent(screen1.this, screen2.class);
- startActivity(i);
- }
- });
- }
- }
- package test.android;
- import android.app.Activity;
- import android.os.Bundle;
- import android.view.View;
- import android.widget.Button;
- public class screen2 extends Activity
- {
- public void onCreate(Bundle icicle)
- {
- super.onCreate(icicle);
- setContentView(R.layout.screen2);
- Button b = (Button) findViewById(R.id.btnClick2);
- b.setOnClickListener(new View.OnClickListener() {
- public void onClick(View arg0) {
- setResult(RESULT_OK);
- finish();
- }
- });
- }
- }
- <?xml version="1.0" encoding="utf-8"?>
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="test.android"
- android:versionCode="1"
- android:versionName="1.0">
- <application android:icon="@drawable/icon" android:label="@string/app_name">
- <activity android:name=".Screen1" android:label="Screen 1">
- <activity android:name=".screen1"
- android:label="@string/app_name">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </activity>
- <activity android:name=".Screen2" android:label="Screen 2">
- </activity>
- </application>
- </manifest>
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- >
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="You are in the first Screen"
- />
- <Button
- android:id ="@+id/btnClick"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Open New Screen"
- />
- </LinearLayout>
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- >
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="You are in the New Screen"
- />
- <Button
- android:id ="@+id/btnClick2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Close"
- />
- </LinearLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement