[android-developers] Re: ProgressDialog results in a FC

2011-03-16 Thread Nadeem Hasan
Are you calling this activity using startActivity(intent)? or are you explicitly calling the onCreate() from your GolfCaddie activity? If the latter then it will not work as you are bypassing a lot of activity setup logic that is needed. Using "DBHelper.this" as the context will not work as the

[android-developers] Re: ProgressDialog results in a FC

2011-03-16 Thread Nadeem Hasan
Another issue is that even if it was working, the progress dialog would never show up as you are blocking the GUI thread. You should use an AsyncTask<> and show the progress dialog in onPreExecute(), do all the db operations in doInBackground() and dismiss the dialog in onPostExecute(). -- Yo

Re: [android-developers] Re: ProgressDialog results in a FC

2011-03-16 Thread David Williams
When I had DBHelper not as an activity then I was getting a different error for ProgressDialog, stating that the number of parameters for show were incorrect, when obviously they weren't. David Williams Check out our WebOS

Re: [android-developers] Re: ProgressDialog results in a FC

2011-03-16 Thread Nadeem Hasan
You must be passing the DBHelper.this as the Context parameter when it clearly would not be if DBHelper was not an Activity. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegro

Re: [android-developers] Re: ProgressDialog results in a FC

2011-03-16 Thread David Williams
Still newish to Java so trying to get my head around many things here :( Ok, so I switched the DBHelper class back so that it wasn't an activity. DBHelper.java now has an error and I can't even build my project. This is the code that is stopping the compile: ProgressDialog dialog; dialog = Progr

Re: [android-developers] Re: ProgressDialog results in a FC

2011-03-16 Thread TreKing
On Wed, Mar 16, 2011 at 8:23 AM, David Williams < dwilli...@dtw-consulting.com> wrote: > Still newish to Java so trying to get my head around many things here :( > It's generally recommended you learn Java on it's own, outside of Android, or you're going to run into very silly issues like this.

Re: [android-developers] Re: ProgressDialog results in a FC

2011-03-16 Thread David Williams
Thanks, I understand what you are saying, and I am trying to learn Java as I go along (granted, not the best way) and do some research on line too. If I change the context to *this* that still doesn't work and still shows the error below, except the context it is showing now is: DBHelper.Datab

Re: [android-developers] Re: ProgressDialog results in a FC

2011-03-16 Thread Nadeem Hasan
DBHelper should take the Context object as a parameter in the ctor. Use this passed context in the call to ProgressDialog.show(). When you instantiate the DBHelper object in GolfCaddie activity, pass "this" as the parameter in the ctor. Also make sure you call the DBHelper method to create the d

Re: [android-developers] Re: ProgressDialog results in a FC

2011-03-16 Thread TreKing
On Wed, Mar 16, 2011 at 8:47 AM, David Williams < dwilli...@dtw-consulting.com> wrote: > If I change the context to *this* that still doesn't work and still shows > the error below, except the context it is showing now is: > DBHelper.DatabaseHelper. Assuming that this is what *this* equates too.

Re: [android-developers] Re: ProgressDialog results in a FC

2011-03-16 Thread David Williams
TreKing / Nadeem / Kostya, Just wanted to say a big thanks to you all for helping me understand AsyncTask and about what a context is and the interaction between the UI thread and AsyncTask threads :) I got it and I have (at least the start of) my app working the way I want it to work. Yes,