我得到一個NotFoundException。我已經用R.java發現它是沒有找到的activity_fullscreen。它與全屏幕效果相同,它是由eclipse創建的一個例子,它可以正常工作。但我的不會跑。 來源:NotFoundException for activity_fullscreen
package com.example.dreamadventure;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageView;
import android.view.View.OnClickListener;
public class FullscreenActivity extends Activity {
ImageView image;
private static final boolean TOGGLE_ON_CLICK = true;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fullscreen);
final View contentView = findViewById(R.id.fullscreen);
image = (ImageView) findViewById(R.id.hintergrund);
image.setImageResource(R.drawable.eulenloch);
}
}
XML:
<View xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fullscreen"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:keepScreenOn="true"
android:layout_centerHorizontal="true"
android:background="#FFFFFF" >
<ImageView android:id="@+id/hintergrund"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="50px"
android:padding="12dip"
android:src="@drawable/eulenloch"
android:background="#FFFFFF">
</ImageView>
</View>
誰能告訴我什麼是錯?
你能有你的logcat登錄 – 2013-02-22 09:22:11
什麼是包含activity_fullscreen.xml該文件夾的名稱? – alex 2013-02-22 09:31:16
它是佈局土地 – user2098738 2013-02-22 10:06:56