Teju-Android / TwitterClient

Android Twitter Client App
0 stars 0 forks source link

ActiveAndroid Error: tweet.save() is unknown #3

Open teju009 opened 9 years ago

teju009 commented 9 years ago

Hi Nathan @nesquena and @thecodepath ,

This is the first time I am using any ORM/ActiveAndroid. I am following the steps and I see that I have set up everything. I am able to set up the tables/columns with the model. But when I do save(), it does not recognize this method. I saw the Common questions, I dont find anything related to this issue. Am I missing anything fundamental? My code is available on the add-ORM branch

nesquena commented 9 years ago

You need to extend every model from the Model class in ActiveAndroid. In order to have the save method you must inherit from the Model base class as shown in the guides.

teju009 commented 9 years ago

Thanks @nesquena for the response. I am looking to Toast a message in case of network waiting for response like the Twitter rate limit exceeded. I see that the onSucess method is not called as the app keeps waiting for data. I looked to see if I can set some time limit after which I can timeout and cancel the request. After looking at the JsonHttpResponseHandler, I dont find any method like that. Whats the best way to accomplish this? Any source you can point to?

nesquena commented 9 years ago

Try overriding handleFailureMessage(Throwable e, String responseBody) for JsonHttpResponseHandler and you should see the rate limit error and can handle it there. You can set timeout with the timeout method in the AsyncHttpClient object