Skip to content Skip to sidebar Skip to footer

Why Application Shuts Down As Soon As It's Launched Even If There's No Error Caution?

I have three xml files for layouts such as activity_behind_left_simple.xml activity_behind_right_simple.xml activity_main.xml I implemented textViews to activity_behind_left_simp

Solution 1:

You need to give a reference to the inflated layout. try this with all the views you are acessing inside setLeftBehindContentView method:

     e.g:  

     IconView iv5 = (IconView) content.findViewById(R.id.iconViewItem5);

Note: i am assuming the view corresponding to R.id.iconViewItems lies inside the inflated layout file.

Solution 2:

It doesn't look like you're inflating activity_behind_right_simple.xml anywhere. As far as I can tell you should be getting a NPE when you try to modify iv5.

edit: if you add the code below to your main layout and enclose the ScrollViews in a FrameLayout this will let it inflate everything during setContentView().

<include
        layout="@layout/leftScrollView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

<include
        layout="@layout/rightScrollView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

Post a Comment for "Why Application Shuts Down As Soon As It's Launched Even If There's No Error Caution?"