Catrobat/Catroid — pull request #680 by ManuelWallner (2013-09-09 13:07:48+00:00)
Title: Fix issue #660

Fix issue #660

Activate "Don't keep activities" in Developer options to reproduce this bug. When invoking the ```FormulaEditorFragment``` from the ```ScriptFragment``` it becomes registered with the ```ScriptActivity``` as the ```ScriptActivity``` is a ```FragmentActivity```. Hence, when leaving the ```ScriptActivity``` by entering the stage and returning again by leaving the stage, it will try to resume its fragments. During this process it tries to access ```formulaTextFieldId``` of ```Formula.java```. However this field is not available (= null) because it is declared transient. When not declaring the ```formulaTextFieldId``` as transient the NullPointerException will be avoided though the ```FormulaEditorFragment``` will be loaded anyway. Because all of this only happens when leaving the ```ScriptActivity``` via the ```PlayButton``` the ```FormulaEditorFragment``` is removed beforehand. So if now returning from stage the ```FormulaEditorFragment``` is not registered with the ```ScriptActivity``` and will not be started by the ```ScriptActivity```.

https://jenkins.catrob.at/job/Catroid-Multi-Job-Custom-Branch/373/
https://jenkins.catrob.at/job/Catroid-single-UI-emulator/218/