java.lang.RuntimeException:二进制XML文件行#24:错误膨胀类片段

时间:2014-04-09 10:34:57

标签: java android xml android-fragments

我的应用程序出现以下错误

java.lang.RuntimeException: Unable to start activity 
ComponentInfo{com.svpino.longhorn/com.appc.longhorn.activities.DashboardActivity}: 
android.view.InflateException: Binary XML file line #24: Error inflating class fragment

当我在Android 4.3中运行应用程序时,它工作正常,一切都正确加载。但是在4.4.2版本上它崩溃了。此外,我在CM 4.4.2上的Galaxy note 3上工作正常。

我的问题是这个设备相关的错误?从堆栈跟踪看起来不像它。

我的XML

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/containerLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<fragment
    android:id="@+id/stockListFragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    class="com.appc.longhorn.fragments.StockListFragment" />

</RelativeLayout>

这是主要活动

public class DashboardActivity extends FragmentActivity implements StockListFragmentCallback, StockQuoteCollectorObserver {

private final static String LOG_TAG = DashboardActivity.class.getName();

private BackStack backStack;
private Dialog searchDialog;
private Dialog noConnectivityDialog;
private Dialog termsAndConditionsDialog;
private StockListFragment stockListFragment;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (Extensions.isPriorHoneycomb()) {
        requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
    }

    setContentView(R.layout.activity_dashboard);

1 个答案:

答案 0 :(得分:0)

您有 IndexOutOfBounds 例外

  

Caused by: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255) at java.util.ArrayList.get(ArrayList.java:308) at com.svpino.longhorn.artifacts.StockTileProcessor.createFixedHeaderRow(StockTileProcessor.java:119)

建议您查看 StockTileProcessor

中的第119行