저는 최근에 R.JAVA를 사용하지 않고 생성하려고했습니다. 나는 다음을 시도했다 1. 매니 페스트 파일에 공백 추가하기. 2. 프로젝트 -> 클린R.Java를 생성 할 때 문제가 발생했습니다.
내 마지막 추측은 내가 할 수있는 xml 파일에 오류가 있다는 것이다. 보다. 그래서 나는 검토를 위해 내 xml 파일을 검사 할 수있는 두 번째 눈 쌍이 있기를 희망했다. 오직 세 가지만 있고 그들은 꽤 기초적이어야합니다 (나는 안드로이드 서적의 소개를 따르고 있습니다).
매니페스트 파일
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.activites"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Activity2"
android:label="Activity 2" >
<intent-filter>
<action android:name="com.example.ACTIVITY2" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/hello_world"
tools:context=".MainActivity" />
</RelativeLayout>
Activity2.xml 바쁜 하루/밤에서 시간을 촬영 한 당신의 모든
다시<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="This is Activity 2!" />
</RelativeLayout>
감사 나 같은 초보자를 도우려고. 또한 XML에 오류가 아닌 다른 제안이 있으면 언제든지 가져올 수 있습니다.
여기 요청으로이 문제보기를 표시> 윈도우 -에 나타납니다 -> 문제
- R가 해결 될 수없는 변수
- R에 해결 될 수없는 변수
- R에 해결 될 수없는 변수로
태그는 분명하지 않지만 다음 코드 줄을 사용하여 catlog에 디버그 정보를 표시하는 데 사용됩니다.
public class MainActivity extends Activity {
String tag = "이벤트";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main);
Log.d(tag, "In the onCreate() event");
}
빌드 할 때 콘솔에 오류/경고가 표시됩니까? – Geobits
_Activity.xml_ 및 _Activity2.xml_에서 각 파일의 끝에는 RelativeLayout>이 있습니까? –
@GabrielNetto 그는 포털의 형식을 잃어 버렸습니다. – Eric