Android:在aidl文件中找不到类java.util.ArrayList的导入
我目前有一个远程服务,可以获取用户当前位置(这一切都工作正常)。我现在希望能够获取用户当前位置,然后将其添加到以前位置的列表中。这是我的aidl 文件,我遇到了问题:
import android.location.Location;
import java.util.ArrayList; //error line: couldn't find import for class java.util.ArrayList
interface ILocationService {
Location getCurrentLocation();
ArrayList<Location> getAllLocations();
}
任何帮助将不胜感激。谢谢。
I currently have a remote service which gets the users current location (this is all working fine). I now want to be able to get the users current location then add a to a list of previous locations. Here is my aidl file, where i'm having a problem :
import android.location.Location;
import java.util.ArrayList; //error line: couldn't find import for class java.util.ArrayList
interface ILocationService {
Location getCurrentLocation();
ArrayList<Location> getAllLocations();
}
Any help would be much appreciated. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
(根据我的评论,这显然解决了问题)
使用
java.util.List
而不是java.util.ArrayList
。(As per my comment, which apparently fixed the problem)
Use
java.util.List<Location>
instead ofjava.util.ArrayList<Location>
.