2015-09-25 49 views
1

好入門,所以我得到這個錯誤:Android的失敗得到了

W/ResourceType﹕ Failure getting entry for 0x01080ac1 (t=7 e=2753) (error -75) 

它發生大約每一次我動態膨脹的佈局,然後將其添加。使用調試器我已經精確定位到:

/** 
* Create a new ScrollableVerticalListView. 
* 
* @param context the context to create the LinearLayout in. 
* @param fullWidth The width to set on the LinearLayout. 
*/ 
public ScrollableVerticalListView(Context context, final int fullWidth) { 
    super(context); 
    setOrientation(LinearLayout.VERTICAL); 
    innerLinearLayout = new LinearLayout(context); 
    innerLinearLayout.setOrientation(LinearLayout.VERTICAL); 

    MainActivity.getInstance().runOnUiThread(
      new Runnable() { 
       @Override 
       public void run() { 
        setWidth(fullWidth); 
       } 
      }); 
    ScrollView scrollView = new ScrollView(context);//<--No error in logcat 
    scrollView.addView(innerLinearLayout);//<--Error in logcat 
    super.addView(scrollView); 
} 

該類擴展了LinearLayout。關於如何擺脫此警告的任何想法?

回答

1

嘗試在R.java項目中跟蹤資源ID 0x01080ac1。檢查資源的路徑是否正確。從答案在這篇文章中發現了這個Android Error - Error inflating class

編輯:從所提供的鏈接的答案引用:

This type of error can be fixed by going to the file R.java and search for the error entry e.g 0x7f0201f2 from your log. It would correspond to a variable. And if you look at the containing method of this entry it will tell you whether it is a string, id, dimen etc. Then you can just search for this variable in your project and find if it has been declared in your resource files.

相關問題