简体   繁体   English

在libGDX中使用Android原始的AsyncTask

[英]Using original AsyncTask from Android in libGDX

I need to use AsyncTask from the android.os package. 我需要使用android.os包中的AsyncTask。 Yes, I know that there is an AsyncTask from the com.badlogic.utils package, but I need those one. 是的,我知道com.badlogic.utils包中有一个AsyncTask,但是我需要这些。 So, I imported that: 因此,我导入了:

import android.os.AsyncTask;

Used SDK: Android 20 API Platform. 二手SDK: Android 20 API Platform.

And when I try to run, I get errors: 当我尝试运行时,出现错误:

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

Does this mean that native Android classes are not active in the libGDX? 这是否意味着本地Android类在libGDX中不活动?

You can't access Android APIs inside core module . 您无法访问core module Android API。 Core module is generic part for all platforms. 核心模块是所有平台的通用部分。

By interfacing you can use access platform specific code. 通过接口,您可以使用访问平台特定的代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM