我得到了错误
Unable to start activity ComponentInfo{de.androidbuch.activiti/de.androidbuch.activiti.task.Activity}: android.view.InflateException: Binary XML file line #11: Error inflating class fragment
Run Code Online (Sandbox Code Playgroud)
当我通过肖像和横向模式切换时.我正在使用片段.我的xml是:
<LinearLayout android:id="@+id/mainLayout"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<ListView android:id="@+id/android:list"
android:layout_height="wrap_content"
android:layout_width="fill_parent"/>
<fragment android:id="@+id/fragmentDetails"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
class="de.androidbuch.activiti.task.TaskDetailsFragment"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
如果我通过横向和纵向模式切换一切正常.但是当我点击我的片段(我可以看到我的片段)然后切换到另一种模式时,我得到了错误.知道怎么解决吗?在这里找到了一些答案,但这些都没有帮助我...
06-21 14:55:05.600: ERROR/AndroidRuntime(7636): FATAL EXCEPTION: main
06-21 14:55:05.600: ERROR/AndroidRuntime(7636): java.lang.RuntimeException: Unable to start activity
ComponentInfo{de.androidbuch.activiti/de.androidbuch.activiti.task.Activity}: android.view.InflateException: Binary XML file line #11: Error inflating class fragment
06-21 14:55:05.600: ERROR/AndroidRuntime(7636): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1736)
06-21 14:55:05.600: ERROR/AndroidRuntime(7636): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1752)
06-21 14:55:05.600: ERROR/AndroidRuntime(7636): at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3097)
06-21 14:55:05.600: ERROR/AndroidRuntime(7636): at android.app.ActivityThread.access$1600(ActivityThread.java:123)
06-21 …Run Code Online (Sandbox Code Playgroud) 我正在使用ListFragment并执行onListItemClick.一切正常,但现在我想使用一个长项目点击(例如setOnItemLongClickListener(一个活动的新OnItemLongClickListener()).我怎么能在我的片段中使用它?
谢谢!
如何将JSONObject转换"{hello1: hi, hello2: hey}"为"hello1: hi, hello2: hey"没有这些括号{ }?
我知道有机会使用JSONObject.tostring然后我会得到一个带括号的字符串.
谢谢大家.