2012-08-16 53 views
0

我得到以下例外

java.lang.RuntimeException: Unable to start activity ComponentInfo{mypackage/mypackage.MyActivity}: android.view.InflateException: Binary XML file line #238: Error inflating class <unknown>

MyActivity的setContentView

protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    requestWindowFeature(Window.FEATURE_NO_TITLE); 
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
      WindowManager.LayoutParams.FLAG_FULLSCREEN); 
    setContentView(R.layout.myxmlfile); // >>>>>>>> This is line 238 

myxmlfile.xml

 <ImageView 
      android:id="@+id/myanimation" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" android:layout_centerInParent="true" 
      android:background="@drawable/myanimationfile" 
      android:visibility="visible" /> 

Caused by: android.content.res.Resources$NotFoundException: File res/drawable/myanimationfile.xml from drawable resource ID #0x7f020027

此文件在指定路徑存在RES /繪製/

在此之後,我得到

Caused by: android.content.res.Resources$NotFoundException: File res/drawable/animation00013.png from drawable resource ID #0x7f02000a

再次,animation00013.png並在路徑中存在

我已經提取該apk使用解壓縮並檢查這些文件。它們存在。

+0

嘗試重新啓動您的工作區並嘗試使用它。 – Praveenkumar 2012-08-16 05:48:51

+0

它是生產中的運行時異常。我想知道,因爲解壓縮有這些文件。 – Siddharth 2012-08-16 05:50:02

回答

1

您是否嘗試過清潔項目?有時候,adt插件不會使用新的id更新R中的資源,以適當考慮文件更改。我之前遇到過這個問題。

相關問題