Tuesday, August 9, 2011

Re: [android-developers] Re: how best to access string resources from AsyncTask.doInBackground

On Tue, Aug 9, 2011 at 7:12 AM, AndyD <andy.dennie@gmail.com> wrote:
Thanks, that's what I've decided to do, at least for now.  I pass the Activity to the AsyncTask's constructor, pull out the strings I want and stick them into member variables for later use by doInBackground().

I was thinking more along the lines of passing them as arguments to execute(), but I guess that works.

new MyTask().execute(getString(R.string.id));

...

doInBackground(String... strings)
 useString(strings[0]);
}

Or something.
-------------------------------------------------------------------------------------------------
TreKing - Chicago transit tracking app for Android-powered devices

--
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@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate