Pressing date input button fast tries to add DatePickerDialog fragment twice
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Collectionista |
Fix Committed
|
Low
|
pjv |
Bug Description
In a (Tabbed) BookItem, if you press the acquired date button repeatedly and fast, then at some point it will crash with: IllegalStateExc
From monkey:
:Switch: #Intent;
// Allowing start of Intent { act=android.
:Sending Touch (ACTION_DOWN): 0:(284.0,271.0)
:Sending Touch (ACTION_UP): 0:(288.
// CRASH: net.lp.
// Short Msg: java.lang.
// Long Msg: java.lang.
// Build Label: samsung/
// Build Changelist: eng.root.
// Build Time: 1350518027000
// java.lang.
// at android.
// at android.
// at android.
// at android.
// at android.
// at android.
// at android.
// at android.
// at java.lang.
// at java.lang.
// at com.android.
// at com.android.
// at dalvik.
//
** Monkey aborted due to error.
Events injected: 3684
:Sending rotation degree=0, persist=false
:Dropped: keys=23 pointers=37 trackballs=0 flips=0 rotations=0
## Network stats: elapsed time=103913ms (0ms mobile, 0ms wifi, 103913ms not connected)
** System appears to have crashed at event 3684 of 10000 using seed 10
Related branches
Changed in collectionista: | |
status: | New → Fix Committed |
importance: | Undecided → Medium |
assignee: | nobody → pjv (pjv) |
It seems some bug with the FragmentsManager or DialogFragment in the v4 support library. All you need to do is keep hammering the watch button to the right on the Meta tab.
Somehow, the previous fragment tapped away by clicking on the target of the button in the shadow is not always entirely gone( ft.remove()?) yet when another click on the button wants to add it (ft.add() or ft.replace()?).
I have tried code such as this and it seems to work better (or maybe my rhythm is off) but still fails (maybe needs to be inside some critical section (synchronized)?):
public void onClick(View v) {... acquisition_ date_change) { ).getSupportFra gmentManager( ).findFragmentB yTag("acquisiti on_date_ picker_ dialog" ); nsaction ft = getActivity( ).getSupportFra gmentManager( ).beginTransact ion()
.remove( f); nDatePickerDial ogFragment. show(getActivit y().getSupportF ragmentManager( ), "acquisition_ date_picker_ dialog" );
if (v.getId() == R.id.b_
// Launch dialog to change acquisition date ....
Fragment f = getActivity(
if (f!=null){
FragmentTra
ft.commit();
} else {
mAcquisitio
}
}
}
Could not find this bug online yet, and it is only really visible with the monkey.