由ClassNotFoundException引起的XML文件中的InflateException

时间:2013-02-21 05:28:53

标签: android android-fragments classnotfoundexception radio-group inflate-exception

android.view.InflateException: Binary XML file line #254: Error inflating class com.****.***.SegmentedRadioGroup
Caused by: java.lang.ClassNotFoundException: com.***.***.SegmentedRadioGroup

这是我的detail.xml文件:

<com.***.***.SegmentedRadioGroup
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_margin="5dip"
    android:orientation="horizontal"
    android:id="@+id/segment_text"
    android:checkedButton="@+id/button_one">

    <RadioButton android:id="@id/button_one"
        android:minWidth="150dip"
        android:minHeight="40dip"
        android:text="One"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:button="@null"
        android:gravity="center"
        android:textColor="@color/radio_colors" />

</com.***.***.SegmentedRadioGroup>

detailfragment.java

public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    final Database db=new Database(getActivity().getApplicationContext());
    View view = inflater.inflate(R.layout.detail, container, false);
    // ...
}

我收到错误:

View view = inflater.inflate(R.layout.detail, container, false);

0 个答案:

没有答案