android - Can not Use Async Class inside an Activity . The Activity already Consist of a Main class extending from Activity -


public class server_activity extends asynctask<void, string, void> {   } 

an error shown when write class:

classserver_activity must either declared abstract or implement abstract method doinbackground(params).

what causing error ?

add method doinbackground(). because asynctask abstract class, contains abstract method doinbackground(). means, class inheriting asynctask class must implement doinbackground() method.

but title seems question, sounding wrote server_activity class in same file of activity. in eclipse error sound like:

the public type testclass must defined in own file

if case: create new .java file , write there server_activity class. , don't forget implement doinbackground() method there.

you can see example of in android developer api.


Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -