Project name:Fragment2

* ADT 2.1.3
* AVD API:23
* WINDOWS 10

MainActivity.java:

```
package com.example.deepaksingh.fragment2;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}
}

```

activity\_main.xml:

```
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

<fragment
    android:id="@+id/fragment2"
    android:name="com.example.deepaksingh.fragment2.Fragment2"
    android:layout_width="10dp"
    android:layout_height="match_parent"
    android:layout_weight="1"
    tools:layout="@layout/fragment2" />

<fragment
    android:id="@+id/fragment1"
    android:name="com.example.deepaksingh.fragment2.Fragment1"
    android:layout_width="10dp"
    android:layout_height="match_parent"
    android:layout_weight="1"
    tools:layout="@layout/fragment1" />

</LinearLayout>

```

Fragment1.java:

```
 package com.example.deepaksingh.fragment2;
import android.os.Bundle;
import android.view.ViewGroup;
import android.view.View;
import android.view.LayoutInflater;
import android.app.Fragment;

public class Fragment1 extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    return inflater.inflate(R.layout.fragment1,container, false);
}

}

```

fragment1.xml

```
<?xml version="1.0" encoding="utf-8" ?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#0000ff"
>

<TextView
    android:id="@+id/textview1"
    android:text="@string/first_fragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    />
</LinearLayout>

```

Fragment2.java

```
package com.example.deepaksingh.fragment2;
import android.os.Bundle;
import android.view.ViewGroup;
import android.view.View;
import android.view.LayoutInflater;
import android.app.Fragment;

public class Fragment2 extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    return inflater.inflate(R.layout.fragment2,container, false);
}

}

```

fragment2.xml

```
<?xml version="1.0" encoding="utf-8" ?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#ff0000"
>

<Textview
    android:id="@+id/textview2"
    android:text="Second Fragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    />
</LinearLayout>

```

AndroidMAnifest.xml

```
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.deepaksingh.fragment2">

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/Theme.AppCompat">
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

</manifest>

```

LOGCAT:
////////////////////////////////////////////////////////////

```
09-16 14:36:29.365 6887-6887/com.example.deepaksingh.fragment2 W/System: ClassLoader referenced unknown path: /data/app/com.example.deepaksingh.fragment2-2/lib/x86
09-16 14:36:29.459 6887-6887/com.example.deepaksingh.fragment2 W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
09-16 14:36:29.539 6887-6887/com.example.deepaksingh.fragment2 D/AndroidRuntime: Shutting down VM
09-16 14:36:29.540 6887-6887/com.example.deepaksingh.fragment2 E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                 Process: com.example.deepaksingh.fragment2, PID: 6887
                                                                                 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.deepaksingh.fragment2/com.example.deepaksingh.fragment2.MainActivity}: android.view.InflateException: Binary XML file line #6: Binary XML file line #9: Binary XML file line #9: Error inflating class Textview
                                                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
                                                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
                                                                                     at android.app.ActivityThread.-wrap11(ActivityThread.java)
                                                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                                                                                     at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                     at android.os.Looper.loop(Looper.java:148)
                                                                                     at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                                     at java.lang.reflect.Method.invoke(Native Method)
                                                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                                                                                  Caused by: android.view.InflateException: Binary XML file line #6: Binary XML file line #9: Binary XML file line #9: Error inflating class Textview
                                                                                     at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
                                                                                     at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
                                                                                     at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
                                                                                     at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284)
                                                                                     at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
                                                                                     at com.example.deepaksingh.fragment2.MainActivity.onCreate(MainActivity.java:12)
                                                                                     at android.app.Activity.performCreate(Activity.java:6237)
                                                                                     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
                                                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
                                                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
                                                                                     at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                                                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
                                                                                     at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                     at android.os.Looper.loop(Looper.java:148) 
                                                                                     at android.app.ActivityThread.main(ActivityThread.java:5417) 
                                                                                     at java.lang.reflect.Method.invoke(Native Method) 
                                                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                                                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
                                                                                  Caused by: android.view.InflateException: Binary XML file line #9: Binary XML file line #9: Error inflating class Textview
                                                                                     at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
                                                                                     at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
                                                                                     at com.example.deepaksingh.fragment2.Fragment2.onCreateView(Fragment2.java:14)
                                                                                     at android.app.Fragment.performCreateView(Fragment.java:2220)
                                                                                     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:949)
                                                                                     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1126)
                                                                                     at android.app.FragmentManagerImpl.addFragment(FragmentManager.java:1228)
                                                                                     at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2201)
                                                                                     at android.app.FragmentController.onCreateView(FragmentController.java:98)
                                                                                     at android.app.Activity.onCreateView(Activity.java:5546)
                                                                                     at android.support.v4.app.BaseFragmentActivityHoneycomb.onCreateView(BaseFragmentActivityHoneycomb.java:36)
                                                                                     at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:75)
                                                                                     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:754)
                                                                                     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
                                                                                     at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
                                                                                     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
                                                                                     at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
                                                                                     at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
                                                                                     at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
                                                                                     at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284) 
                                                                                     at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
                                                                                     at com.example.deepaksingh.fragment2.MainActivity.onCreate(MainActivity.java:12) 
                                                                                     at android.app.Activity.performCreate(Activity.java:6237) 
                                                                                     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 
                                                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 
                                                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
                                                                                     at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                                                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
                                                                                     at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                     at android.os.Looper.loop(Looper.java:148) 
                                                                                     at android.app.ActivityThread.main(ActivityThread.java:5417) 
                                                                                     at java.lang.reflect.Method.invoke(Native Method) 
                                                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                                                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
                                                                                  Caused by: android.view.InflateException: Binary XML file line #9: Error inflating class Textview
                                                                                     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:776)
                                                                                     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
                                                                                     at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
                                                                                     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
                                                                                     at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
                                                                                     at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
                                                                                     at com.example.deepaksingh.fragment2.Fragment2.onCreateView(Fragment2.java:14) 
                                                                                     at android.app.Fragment.performCreateView(Fragment.java:2220) 
                                                                                     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:949) 
                                                                                     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1126) 
                                                                                     at android.app.FragmentManagerImpl.addFragment(FragmentManager.java:1228) 
                                                                                     at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2201) 
                                                                                     at android.app.FragmentController.onCreateView(FragmentController.java:98) 
                                                                                     at android.app.Activity.onCreateView(Activity.java:5546) 
                                                                                     at android.support.v4.app.BaseFragmentActivityHoneycomb.onCreateView(BaseFragmentActivityHoneycomb.java:36) 
                                                                                     at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:75) 
                                                                                     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:754) 
                                                                                     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 
                                                                                     at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) 
                                                                                     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
                                                                                     at android.view.LayoutInflater.inflate(LayoutInflater.java:515) 
                                                                                     at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
                                                                                     at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
                                                                                     at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284) 
                                                                                     at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
                                                                                     at com.example.deepaksingh.fragment2.MainActivity.onCreate(MainActivity.java:12) 
                                                                                     at android.app.Activity.performCreate(Activity.java:6237) 
                                                                                     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 
                                                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 
                                                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
                                                                                     at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                                                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
                                                                                     at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                     at android.os.Looper.loop(Looper.java:148) 
                                                                                     at android.app.ActivityThread.main(ActivityThread.java:5417) 
                                                                                     at java.lang.reflect.Method.invoke(Native Method) 
                                                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                                                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
                                                                                  Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.Textview" on path: DexPathList[[zip file "/data/app/com.example.deepaksingh.fragment2-2/base.apk"],nativeLibraryDirectories=[/data/app/com.example.deepaksingh.fragment2-2/lib/x86, /vendor/lib, /system/lib]]
                                                                                    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassL
09-16 14:36:34.205 6887-6887/com.example.deepaksingh.fragment2 I/Process: Sending signal. PID: 6887 SIG: 9

```