An-droid
An-droid

Reputation: 6485

Remove fragment crash

I add and remove fragments like this :

ADD

getSherlockActivity().getSupportFragmentManager()
                                .beginTransaction()
                                .setCustomAnimations(R.anim.slide_in_bottom, R.anim.slide_out_top, R.anim.slide_in_top, R.anim.slide_out_bottom)
                                .add(R.id.fragment_explore, fragment)
                                .addToBackStack(null)
                                .commit();
ActivityMain.BACKSTACK_EXPLORE.add(fragment);

REMOVE

Fragment depopFragment = BACKSTACK_EXPLORE.get(BACKSTACK_EXPLORE.size() - 1);
                    getSupportFragmentManager().beginTransaction()
                                                .setCustomAnimations(R.anim.slide_in_top, R.anim.slide_out_bottom, R.anim.slide_in_bottom, R.anim.slide_out_top)
                                                .remove(depopFragment)
                                                .commit();
                    BACKSTACK_EXPLORE.remove(depopFragment);

There is a fast slide animation. The fragment comes from bottom and goes back to bottom.

My issue is when you press the back button (depop the fragment) and before the animation is finished you touch the activity that is appearing behind.

It gives me a simple Fatal signal 11 error (more often on samsung galaxy s3)

Any idea ?

Upvotes: 5

Views: 712

Answers (1)

An-droid
An-droid

Reputation: 6485

I resolved it, it was related to onCreateAnimation() that i used to know when the animation was finished

view.setLayerType(LAYER_TYPE_NONE, null); 

this line was doing the crash. It seems to be related to hardware acceleration and most likely only on android 4.3

see this link : Disable hardware acceleration, backward compatibility

Upvotes: 8

Related Questions