App force closes while open from recent used apps in google nexus
<p>After use of my app i am pressing the Home to go app in background.here if i opened the app immediately again its opening the app.</p>

<p>But if i open the app after sometime means example 15 mins from recents its force closes the app with below logcat info</p>

<pre><code>01-24 11:04:37.311: I/dalvikvm(6418): Turning on JNI app bug workarounds for target SDK version 8...
01-24 11:04:37.639: W/dalvikvm(6418): threadid=1: thread exiting with uncaught exception (group=0x41c71930)
01-24 11:04:37.654: E/AndroidRuntime(6418): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.roseenvy.ui.activities/com.roseenvy.ui.activities.AppHomeScreen}: android.view.InflateException: Binary XML file line #8: Error inflating class fragment
01-24 11:04:37.654: E/AndroidRuntime(6418): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
01-24 11:04:37.654: E/AndroidRuntime(6418): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
01-24 11:04:37.654: E/AndroidRuntime(6418): at android.app.ActivityThread.access$600(ActivityThread.java:141)
01-24 11:04:37.654: E/AndroidRuntime(6418): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
01-24 11:04:37.654: E/AndroidRuntime(6418): at android.os.Handler.dispatchMessage(Handler.java:99)
01-24 11:04:37.654: E/AndroidRuntime(6418): at android.os.Looper.loop(Looper.java:137)
01-24 11:04:37.654: E/AndroidRuntime(6418): at android.app.ActivityThread.main(ActivityThread.java:5039)
01-24 11:04:37.654: E/AndroidRuntime(6418): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
01-24 11:04:37.654: E/AndroidRuntime(6418): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
01-24 11:04:37.654: E/AndroidRuntime(6418): Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class fragment
01-24 11:04:37.654: E/AndroidRuntime(6418): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
01-24 11:04:37.654: E/AndroidRuntime(6418): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
01-24 11:04:37.654: E/AndroidRuntime(6418): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
01-24 11:04:37.654: E/AndroidRuntime(6418): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
01-24 11:04:37.654: E/AndroidRuntime(6418): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
01-24 11:04:37.654: E/AndroidRuntime(6418): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
01-24 11:04:37.654: E/AndroidRuntime(6418): at android.app.Activity.setContentView(Activity.java:1881)
01-24 11:04:37.654: E/AndroidRuntime(6418): at com.roseenvy.ui.activities.AppHomeScreen.onCreate(AppHomeScreen.java:34)
01-24 11:04:37.654: E/AndroidRuntime(6418): at android.app.Activity.performCreate(Activity.java:5104)
01-24 11:04:37.654: E/AndroidRuntime(6418): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
01-24 11:04:37.654: E/AndroidRuntime(6418): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
01-24 11:04:37.654: E/AndroidRuntime(6418): at com.roseenvy.ui.fragments.Special.onCreateView(Special.java:42)
01-24 11:04:37.654: E/AndroidRuntime(6418): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:846)
01-24 11:04:37.654: E/AndroidRuntime(6418): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1061)
01-24 11:04:37.654: E/AndroidRuntime(6418): at android.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:1160)
01-24 11:04:37.654: E/AndroidRuntime(6418): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:272)
01-24 11:04:37.654: E/AndroidRuntime(6418): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676)
</code></pre>

<p>This is only happening in my google nexus .I tested the app in LG optimus and google tab2 also on these  devices  app working without errors. </p>

<p>my activity layout is</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;ViewFlipper xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/pageflip"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@color/white" &gt;

    &lt;fragment
        android:name="com.roseenvy.ui.fragments.Special"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" 
     /&gt;

    &lt;fragment
        android:name="com.roseenvy.ui.fragments.CreateMyOwnViewPager"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" 
        android:id="@+id/fragcreatehome"
      /&gt;

    &lt;fragment
        android:id="@+id/previewfrag"
        android:name="com.roseenvy.ui.fragments.PreviewFragment"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" /&gt;

    &lt;fragment
        android:id="@+id/addmessagefrag"
        android:name="com.roseenvy.ui.fragments.AddMessage"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" /&gt;

    &lt;fragment
        android:name="com.roseenvy.ui.fragments.BuyNow"
        android:id="@+id/buynowfrag"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" /&gt;

    &lt;fragment
        android:name="com.roseenvy.ui.fragments.ConfirmOrder"
        android:layout_width="fill_parent"
        android:id="@+id/confirmfrag"
        android:layout_height="fill_parent" /&gt;

&lt;/ViewFlipper&gt;
</code></pre>

<p>And this is my fragment layout</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" &gt;

    &lt;ImageView
        android:id="@+id/i_spf_spl_image"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:scaleType="fitXY" /&gt;

    &lt;RelativeLayout
        android:id="@+id/specialLayout"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" &gt;

        &lt;ImageView
            android:id="@+id/i_spf_transp_logo"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="10dp"
            android:src="@drawable/transp_logo" /&gt;

        &lt;LinearLayout
            android:id="@+id/spf_spl_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:orientation="vertical" &gt;

            &lt;ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:src="@drawable/this_weeks_special" /&gt;

            &lt;com.roseenvy.ui.customviews.RoseTextView
                android:id="@+id/specialPrice"
                style="@style/SpecialText"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerInParent="true"
                android:layout_gravity="center_horizontal"
                android:layout_marginTop="10dp"
                android:background="@drawable/price_bkg"
                android:paddingLeft="10dp"
                android:paddingRight="10dp"
                android:textSize="45sp" /&gt;

            &lt;com.roseenvy.ui.customviews.RoseTextView
                android:id="@+id/specialTitle"
                style="@style/SpecialText"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp"
                android:layout_marginTop="10dp"
                android:singleLine="true"
                android:text="@string/title"
                android:textColor="@color/white"
                android:textSize="50sp" /&gt;

            &lt;LinearLayout
                android:id="@+id/gospecial"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:orientation="horizontal" &gt;

                &lt;com.roseenvy.ui.customviews.RoseTextView
                    android:id="@+id/t_spf_spl_price"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/see_special_offer"
                    android:textColor="@color/white"
                    android:textSize="19sp" /&gt;

                &lt;ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:layout_marginLeft="5dp"
                    android:src="@drawable/spl_offer_arrow" /&gt;
            &lt;/LinearLayout&gt;
        &lt;/LinearLayout&gt;

        &lt;FrameLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:background="@drawable/create_your_own" &gt;

            &lt;LinearLayout
                android:id="@+id/createownbottom"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:orientation="vertical"
                android:paddingTop="7dp" &gt;

                &lt;ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal"
                    android:src="@drawable/down_arrow" /&gt;

                &lt;com.roseenvy.ui.customviews.RoseTextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="2dp"
                    android:text="@string/createyourown"
                    android:textColor="@color/white"
                    android:textSize="14sp" /&gt;
            &lt;/LinearLayout&gt;
        &lt;/FrameLayout&gt;
    &lt;/RelativeLayout&gt;

&lt;/FrameLayout&gt;
</code></pre>

<p>Activity Code</p>

<pre><code>public class AppHomeScreen extends FragmentActivity {

    public static ViewFlipper pageFlip;

    private Utils utils;

    public AppPreferences appPreferences;
    @Override
    protected void onCreate(Bundle bundle) {

        super.onCreate(bundle);
        setContentView(R.layout.apphome);
        pageFlip = (ViewFlipper) findViewById(R.id.pageflip);
        appPreferences = new AppPreferences(this);
        utils = new Utils();
    }
}
</code></pre>

<p>Fragment Code</p>

<pre><code>public class Special extends BaseFragment implements OnClickListener {
    private ImageView specialBg;
    private RoseTextView title, price;
    public Bitmap bg;
    private LinearLayout createownbottom, gospecial;
    private SpecialProduct specialProduct;
    private String roseColor;
    public static boolean special = false;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {

        View v = inflater.inflate(R.layout.special_fragment, container, false);
        // pageFlip = AppHomeScreen.pageFlip;
        specialBg = (ImageView) v.findViewById(R.id.i_spf_spl_image);
        ImageDownloader imageLoader = new ImageDownloader(getActivity(), false);
        imageLoader.setMode(Mode.CORRECT);

        specialProduct = ApplicationData.getSpecialProduct();
        imageLoader.download(specialProduct.getSpecialImage(), specialBg, null);

        roseColor = specialProduct.getRoseInfo().getColor();
        title = (RoseTextView) v.findViewById(R.id.specialTitle);
        title.setText(specialProduct.getTitle().toUpperCase());
        price = (RoseTextView) v.findViewById(R.id.specialPrice);
        price.setText(getString(R.string._) + specialProduct.getPrice());
        price.setTextColor(Color.parseColor("#" + roseColor));
        createownbottom = (LinearLayout) v.findViewById(R.id.createownbottom);
        createownbottom.setOnClickListener(this);
        gospecial = (LinearLayout) v.findViewById(R.id.gospecial);
        gospecial.setOnClickListener(this);
        return v;
    }
}
</code></pre>
