apps crashes when navigating in it

Bug #1317845 reported by Donatas Baliuka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openerp-mobile
New
Undecided
Unassigned

Bug Description

I downloaded an apps with a fixed synchronization error from http://mobile.openerp.co.in/_downloads/openerp-mobile-crm.zip
I adapted the leads for our database. The apps crashes in these cases:
1) When I choose to display the leads list second time it crashes on this line in Lead.java:
OEDataRow row = (OEDataRow) mLeadItems.get(position);
Logcat shows that position is 0 and size of mLeadItems is 0.
I added a check: if (mLeadsItems.size>position)
This allows to display leads list more times.

After this I noticed more cases when the apps crashed:
2) The apps crashes on navigating with back button( the logcat writes that "fragment is already set");

3)The apps crashes when the orientation of a device is changed from landscape to portrait or vice versa.

Revision history for this message
Donatas Baliuka (donatas-baliuka-0) wrote :

I analyzed crashes of type 3 and noticed that some classes derived from BaseFragment(eg. AboutFragment)
have code:
public void onDestroy() {
  super.onDestroy();
  scope.main().getActionBar().setDisplayHomeAsUpEnabled(true);
  scope.main().getActionBar().setHomeButtonEnabled(true);
 }
and some have code:
public void onStop() {
 {
  super.onStop();
  scope.main().getActionBar().setDisplayHomeAsUpEnabled(true);
  scope.main().getActionBar().setHomeButtonEnabled(true);
 }

Crashes sometimes happen in the classes with onDestroy() method( null pointer exception).
I have a question: When a class must have code in the method onDestroy() and when in the method onStop()?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.