2013-02-22 19 views
0

我得到一個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> 

誰能告訴我什麼是錯?

+0

你能有你的logcat登錄 – 2013-02-22 09:22:11

+0

什麼是包含activity_fullscreen.xml該文件夾的名稱? – alex 2013-02-22 09:31:16

+0

它是佈局土地 – user2098738 2013-02-22 10:06:56

回答

0

視圖不會持有任何其他視圖,佈局文件是錯誤的,使用的LinearLayout而不是查看,清理項目,也將努力

更新

 <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.DEFAULT" /> 
     </intent-filter> 

使用上述這種過濾器insteed在你活動mainfest

 <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
+0

嗯,它沒有。在eclipse中它說:「[2013-02-22 10:56:51 - Dreamadventure] /Dreamadventure/bin/Dreamadventure.apk安裝在設備上 [2013-02-22 10:56:51 - Dreamadventure]完成!」但是設備上沒有任何反應,並且該應用沒有顯示在設備上已安裝的應用中。 – user2098738 2013-02-22 09:59:41

+0

你可以粘貼你的主文件 – 2013-02-22 10:01:36

+0

http://pastie.org/6315584 – user2098738 2013-02-22 10:07:26

相關問題