如何延长2班? [英] How to extend 2 classes?

查看:187
本文介绍了如何延长2班?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个愚蠢的问题,但我努力就如何使我的课在同一时间延长2班。我试图让使用ListActivity的服务。我怎么能这样做呢?

This might be a silly question, but I'm struggling on how to make my class extend 2 classes at the same time. I'm trying to make a SERVICE that uses ListActivity. How could I do that?

推荐答案

我假设你在 Java编程语言的编码。那么简单的答案是:你不知道。 Java不支持从多个类派生。
让你的 ListActivity 包含服务

I assume you are coding in the Java programming language. Then the simple answer is: You don't. Java does not support deriving from multiple classes. Make your ListActivity contain a Service.

class MyService extends Service{
  ...
}

class MyList extends ListActivity{
    MyService service = new MyService();
}

这篇关于如何延长2班?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆