我想使用AsyncTaskfrom package android.os。是的,我知道AsyncTask包装中有一个com.badlogic.utils,但我需要第一个。因此,我导入了这个:
import android.os.AsyncTask;
使用的 SDK:Android 20 API Platform.
当我运行时出现错误:
Error:(4, 18) error: package android.os does not exist
Error:(146, 38) error: cannot find symbol class AsyncTask
Error:(30, 26) error: cannot find symbol method execute()
Error:(148, 9) error: method does not override or implement a method from a supertype
这不仅适用于 AsyncTask,我还没有找到关于如何为 Android 使用“本机”类的充分解释。感激的。
事实证明,无法从核心模块访问 Android API。该模块用于所有平台。
但是有一种方法可以解决这个问题 - 使用接口,您可以访问平台的功能。