Note that there are some explanatory texts on larger screens.

plurals
  1. POCan any one tell me what this logcat is demanding for? Fragments in android
    text
    copied!<p>Right now i am trying to create one sample fragment program in android,so far i am following this <a href="https://github.com/survivingwithandroid/Surviving-with-android" rel="nofollow">link</a> for reference and i got the project from this site itself. After imported of this project,i could not run this project and i am getting issues like the below logcat.</p> <p>Can any one please tell me what the below logcat is demanding for? in android.</p> <p><strong>LOGCAT</strong></p> <pre><code>12-30 10:54:05.660: E/AndroidRuntime(22318): FATAL EXCEPTION: main 12-30 10:54:05.660: E/AndroidRuntime(22318): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.survivingwithandroid.fragment/com.survivingwithandroid.fragment.MainActivity}: android.view.InflateException: Binary XML file line #12: Error inflating class fragment 12-30 10:54:05.660: E/AndroidRuntime(22318): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2110) 12-30 10:54:05.660: E/AndroidRuntime(22318): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135) 12-30 10:54:05.660: E/AndroidRuntime(22318): at android.app.ActivityThread.access$700(ActivityThread.java:140) 12-30 10:54:05.660: E/AndroidRuntime(22318): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237) 12-30 10:54:05.660: E/AndroidRuntime(22318): at android.os.Handler.dispatchMessage(Handler.java:99) 12-30 10:54:05.660: E/AndroidRuntime(22318): at android.os.Looper.loop(Looper.java:137) 12-30 10:54:05.660: E/AndroidRuntime(22318): at android.app.ActivityThread.main(ActivityThread.java:4921) 12-30 10:54:05.660: E/AndroidRuntime(22318): at java.lang.reflect.Method.invokeNative(Native Method) 12-30 10:54:05.660: E/AndroidRuntime(22318): at java.lang.reflect.Method.invoke(Method.java:511) 12-30 10:54:05.660: E/AndroidRuntime(22318): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038) 12-30 10:54:05.660: E/AndroidRuntime(22318): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805) 12-30 10:54:05.660: E/AndroidRuntime(22318): at dalvik.system.NativeStart.main(Native Method) 12-30 10:54:05.660: E/AndroidRuntime(22318): Caused by: android.view.InflateException: Binary XML file line #12: Error inflating class fragment 12-30 10:54:05.660: E/AndroidRuntime(22318): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 12-30 10:54:05.660: E/AndroidRuntime(22318): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) 12-30 10:54:05.660: E/AndroidRuntime(22318): at android.view.LayoutInflater.inflate(LayoutInflater.java:489) 12-30 10:54:05.660: E/AndroidRuntime(22318): at android.view.LayoutInflater.inflate(LayoutInflater.java:396) 12-30 10:54:05.660: E/AndroidRuntime(22318): at android.view.LayoutInflater.inflate(LayoutInflater.java:352) 12-30 10:54:05.660: E/AndroidRuntime(22318): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:316) 12-30 10:54:05.660: E/AndroidRuntime(22318): at android.app.Activity.setContentView(Activity.java:1924) 12-30 10:54:05.660: E/AndroidRuntime(22318): at com.survivingwithandroid.fragment.MainActivity.onCreate(MainActivity.java:32) 12-30 10:54:05.660: E/AndroidRuntime(22318): at android.app.Activity.performCreate(Activity.java:5188) 12-30 10:54:05.660: E/AndroidRuntime(22318): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094) 12-30 10:54:05.660: E/AndroidRuntime(22318): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074) 12-30 10:54:05.660: E/AndroidRuntime(22318): ... 11 more 12-30 10:54:05.660: E/AndroidRuntime(22318): Caused by: java.lang.NullPointerException: name == null 12-30 10:54:05.660: E/AndroidRuntime(22318): at java.lang.VMClassLoader.findLoadedClass(Native Method) 12-30 10:54:05.660: E/AndroidRuntime(22318): at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:354) 12-30 10:54:05.660: E/AndroidRuntime(22318): at java.lang.ClassLoader.loadClass(ClassLoader.java:491) 12-30 10:54:05.660: E/AndroidRuntime(22318): at java.lang.ClassLoader.loadClass(ClassLoader.java:461) 12-30 10:54:05.660: E/AndroidRuntime(22318): at android.app.Fragment.instantiate(Fragment.java:574) 12-30 10:54:05.660: E/AndroidRuntime(22318): at android.app.Fragment.instantiate(Fragment.java:552) 12-30 10:54:05.660: E/AndroidRuntime(22318): at android.app.Activity.onCreateView(Activity.java:4831) 12-30 10:54:05.660: E/AndroidRuntime(22318): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680) 12-30 10:54:05.660: E/AndroidRuntime(22318): ... 21 more </code></pre> <p><strong>layout-land/activity_main.xml</strong></p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity" android:orientation="horizontal" &gt; &lt;fragment android:id="@+id/listFragment" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;FrameLayout android:id="@+id/fragPage" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="4" /&gt; &lt;/LinearLayout&gt; </code></pre> <p><strong>layout-port/activity_main.xml</strong></p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity" &gt; &lt;fragment android:id="@+id/listFragment" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p><strong>layout-port/linklist_layout.xml</strong></p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;ListView android:id="@+id/urls" android:layout_height="match_parent" android:layout_width="wrap_content"/&gt; &lt;/LinearLayout&gt; </code></pre> <p><strong>layout-port/row_layout.xml</strong></p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" &gt; &lt;TextView android:id="@+id/name" android:layout_width="wrap_content" android:layout_height="wrap_content"/&gt; &lt;TextView android:id="@+id/link" android:layout_width="wrap_content" android:layout_height="wrap_content"/&gt; &lt;/LinearLayout&gt; </code></pre> <p><strong>layout-port/web_layout.xml</strong></p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;WebView android:id="@+id/webPage" android:layout_height="wrap_content" android:layout_width="wrap_content"/&gt; &lt;/LinearLayout&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload