alaurenz / metrobike

0 stars 1 forks source link

Crashes Pressing Find Button #52

Closed CoolCapri closed 11 years ago

CoolCapri commented 11 years ago

I pull the latest snapshot of our repo and, as Sam said, I got crash information when I press find button. The workflow of this button is:

  1. Setting up a click listener to this button
  2. Once the listener is clicked, it shows a waiting dialog indicating searching status, creates a thread to call DirectionRequest.doRequest() and send dReq.getSolutions() to ResultsActivity via an intent

The currently there are 2 problems that causes crashes pressingFind button:

  1. I call DirectionRequest.doRequest(), and then DirectionRequest.doRequest() calls SimpleAlgorithm.findRoutes(), then it throws a null pointer exception. Since my activity is the caller of doRequest(), it appears that my activity crashes.
  2. When I comment out DirectionRequest.doRequest() and send a null via the intent, it also crashes because ResultsActivity does not handle null case yet, but it is needed.

So, @dutchscout @coreyh3: Could you guys try to press this button and find the reason for NullPointerException?

@csmengwan: Could you handle the null case when I send it via intent?

I will be working on re-designing layout for SearchActivity and please tell me any changes required for my code so that I can adapt SearchActivity to your bug-fixed code.

csmengwan commented 11 years ago

ResultsActivity now handles the case. Wait for the first bug to be fixed so I can test my scrollable button lists.

dutchscout commented 11 years ago

I'll work on this issue now. Basically, we accidentally started using live JSON before it was ready. I'll switch it back to the dummy JSON.

dutchscout commented 11 years ago

OK. the dummy code is now in doRequest(). I made a separate method (doLiveRequest()) for testing only. Please continue to use doRequest.

Does this fix the problem for you?

CoolCapri commented 11 years ago

@dutchscout Yes, now it works. Both problems are fixed. Thanks