CMPUT301W16T15 / Shareo

Group Project Android App
MIT License
3 stars 0 forks source link

Back button problems #12

Closed 0x4849a closed 8 years ago

0x4849a commented 8 years ago

Back button problems :

If you press back to the login screen, then you log in(with any user) and try to edit a game, Shareo will crash with: FATAL EXCEPTION: main Process: cmput301w16t15.shareo, PID: 5834 java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.app.FragmentActivity.runOnUiThread(java.lang.Runnable)' on a null object reference at cmput301w16t15.shareo.HomeFragment.update(HomeFragment.java:137) at mvc.Observable.notifyViews(Observable.java:26) at mvc.Thing.update(Thing.java:201) at cmput301w16t15.shareo.AddGameFragment.saveAllText(AddGameFragment.java:94) at cmput301w16t15.shareo.AddGameFragment.access$000(AddGameFragment.java:36) at cmput301w16t15.shareo.AddGameFragment$3.onClick(AddGameFragment.java:132) at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:163) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Short version : After pressing the save button in Edit Game, it's crashing here on Homefragment.update() which calls observer.update(this) in Observable which calls thing.update(), etc.

Also, if you press back at any point to get to the login screen, your future bids won't save. It doesn't matter if you change users, these problems will probably persist regardless. I am guessing these are some of the bugs we experienced in the lab but we weren't aware of it at the time.

I rolled back my source files to before I was using serializable, and it doesn't seem to have anything to do with that since that crash still happens before it was being used.

Bradshawz commented 8 years ago

Probably because we don't de register our observer on destroy of an activity. Which we should do. On Mar 21, 2016 3:29 PM, "0x4849a" notifications@github.com wrote:

Back button problems :

If you press back to the login screen, then you in and try to edit a game, Shareo will crash with: FATAL EXCEPTION: main Process: cmput301w16t15.shareo, PID: 5834 java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.app.FragmentActivity.runOnUiThread(java.lang.Runnable)' on a null object reference at cmput301w16t15.shareo.HomeFragment.update(HomeFragment.java:137) at mvc.Observable.notifyViews(Observable.java:26) at mvc.Thing.update(Thing.java:201) at cmput301w16t15.shareo.AddGameFragment.saveAllText(AddGameFragment.java:94) at cmput301w16t15.shareo.AddGameFragment.access$000(AddGameFragment.java:36) at cmput301w16t15.shareo.AddGameFragment$3.onClick(AddGameFragment.java:132) at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:163) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Short version : After pressing the save button in Edit Game, it's crashing here on Homefragment.update() which calls observer.update(this) in Observable which calls thing.update(), etc.

Also, if you press back at any point to get to the login screen, your future bids won't save. It doesn't matter if you change users, these problems will probably persist regardless. I am guessing these are some of the bugs we experienced in the lab but we weren't aware of it at the time.

I rolled back my source files to before I was using serializable, and it doesn't seem to have anything to do with that since that crash still happens before it was being used.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/CMPUT301W16T15/Shareo/issues/12

0x4849a commented 8 years ago

I think whats maybe happening is that if you press back, the background thread is still running. There is probably some issues with that.

Bradshawz commented 8 years ago

Thread would complete in less than .1 second On Mar 21, 2016 3:43 PM, "0x4849a" notifications@github.com wrote:

I think whats maybe happening is that if you press back, the background thread is still running. There is probably some issues with that.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/CMPUT301W16T15/Shareo/issues/12#issuecomment-199499853

0x4849a commented 8 years ago

Edit game seems to be fine now after pressing back. But bidding is still kinda bugged. You have to enter the AddBidFragment twice after pressing back to login screen to see the new bid show up. >_<

0x4849a commented 8 years ago

Unable to reproduce the bid bug with recent changes. Everything else is good, so closed.