Sunday, September 9, 2012

Re: [android-developers] Google's Android developer tutorial problem

That appears to be a typo in that training page. Instead of:

private class DownloadWebpageText extends AsyncTask

use:

private class DownloadWebpageText extends AsyncTask<String, Void, String>

to match up with the rest of their code listing.

On Sat, Sep 8, 2012 at 11:16 AM, Arei Kuen <fica4ever@gmail.com> wrote:
> I'm a beginner and just started reading google's android tutorial and i came
> across a problem.
> On this link:
> https://developer.android.com/training/basics/network-ops/connecting.html#AsyncTask
> When i try to write a class which extends AsyncTask the class automatically
> implements the 'protected Object doInBackground(Object... params) { ... }
> but when i write 'protected String doInBackground(String... params) { ... }
> i get an error saying 'The method doInBackground(String...) of type
> MainActivity.DownloadWebpageText must override a superclass method'.
> How do i get it to accept the String type?
>
> --
> 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



--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 4.1 Available!

--
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

No comments:

Post a Comment