2

我从几个用户那里得到了这个崩溃报告。他们使用的是三星 SPH-M840 Android 4.1 版。我正在膨胀的布局很简单,里面FrameLayout有一个标签。fragment我正在使用操作栏兼容。

    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.customprogrammingsolutions.ShabbosAlarm\/com.cpsolutions.alarmbase.alarm.AlarmMainActivity}: android.view.InflateException: Binary XML file line #30: Error inflating class com.android.internal.widget.ActionBarView
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2062)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2087)
    at android.app.ActivityThread.access$600(ActivityThread.java:133)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1198)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4777)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:998)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:765)
    at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #30: Error inflating class com.android.internal.widget.ActionBarView
    at android.view.LayoutInflater.createView(LayoutInflater.java:619)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:693)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:752)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:760)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:495)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
    at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:3298)
    at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:3358)
    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:314)
    at android.app.Activity.setContentView(Activity.java:1901)
    at android.support.v7.app.ActionBarActivity.superSetContentView(ActionBarActivity.java:208)
    at android.support.v7.app.ActionBarActivityDelegateICS.setContentView(ActionBarActivityDelegateICS.java:111)
    at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:76)
    at com.cpsolutions.alarmbase.alarm.AlarmMainActivity.onCreate(AlarmMainActivity.java:57)
    at android.app.Activity.performCreate(Activity.java:5042)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2026)
    ... 11 more
Caused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Constructor.constructNative(Native Method)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
    at android.view.LayoutInflater.createView(LayoutInflater.java:593)
    ... 28 more
Caused by: android.view.InflateException: Binary XML file line #36: Error inflating class android.widget.TextView
    at android.view.LayoutInflater.createView(LayoutInflater.java:619)
    at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
    at android.view.LayoutInflater.onCreateView(LayoutInflater.java:666)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:691)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:752)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:760)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:495)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
    at com.android.internal.widget.ActionBarView.initTitle(ActionBarView.java:834)
    at com.android.internal.widget.ActionBarView.setDisplayOptions(ActionBarView.java:631)
    at com.android.internal.widget.ActionBarView.<init>(ActionBarView.java:265)
    ... 31 more
Caused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Constructor.constructNative(Native Method)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
    at android.view.LayoutInflater.createView(LayoutInflater.java:593)
    ... 41 more
Caused by: java.lang.NullPointerException
    at android.server.BluetoothPanProfileHandler.createNewTetheringAddressLocked(BluetoothPanProfileHandler.java:332)
    at android.text.method.SingleLineTransformationMethod.<init>(SingleLineTransformationMethod.java:33)
    at android.text.method.SingleLineTransformationMethod.getInstance(SingleLineTransformationMethod.java:57)
    at android.widget.TextView.applySingleLine(TextView.java:7147)
    at android.widget.TextView.<init>(TextView.java:1208)
    at android.widget.TextView.<init>(TextView.java:606)
    ... 44 more

编辑:这是 xml,onCreateAlarmMainActivity

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <fragment class="com.cpsolutions.alarmbase.alarm.AlarmListFragment"
          android:id="@+id/alarm_list_frag"
          android:layout_width="match_parent"
          android:layout_height="match_parent"/>
</FrameLayout>

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    alarmFrag = (AlarmListFragment) getSupportFragmentManager().findFragmentById(R.id.alarm_list_frag);
    preferenceFrag = (AlarmPreferenceFragment) getSupportFragmentManager().findFragmentById(R.id.preference_list_frag);
    if(preferenceFrag != null) {
        isTwoPane = true;
    }
}
4

2 回答 2

0

你有一个NullPointerException

android.server.BluetoothPanProfileHandler.createNewTetheringAddressLocked(BluetoothPanProfileHandler.java:332)

于 2013-11-10T02:01:41.910 回答
0

使用的布局文件存在问题:

com.cpsolutions.alarmbase.alarm.AlarmMainActivity.java

在第 57 行,将有一个setContentView带有参数R.layout.{insert name here}

转到res/layout/{在此处插入名称}.xml并解决问题。

如果您需要帮助,请在此处发布 XML 文件。


编辑:

该错误是因为它无法为 ActionBarView 充气。请张贴班级声明。(它继承了什么或extends

于 2014-02-09T16:34:15.283 回答