我使用 Eclipse ADT 制作了 MasterActivity 和 DetailsActivity,并在我的手机和平板电脑上对其进行了测试,但当我用另一台平板电脑测试它时,我遇到了这个错误
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.website.softarge/solutions.SolutionListActivity}: android.view.InflateException: Binary XML file line #24: Error inflating class fragment
我的代码:
public class SolutionListActivity extends FragmentActivity implements
SolutionListFragment.Callbacks {
...
// this line causes the error
setContentView(R.layout.activity_solution_list);
...
}
此代码必须调用此 Fragment
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/solution_list"
android:name="solutions.SolutionListFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
tools:context=".SolutionListActivity"
tools:layout="@android:layout/list_content" />