我可以在服务中制作按钮吗? [英] Can I Make a Button In a Service ?

查看:67
本文介绍了我可以在服务中制作按钮吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨人。

我正在开发一个Android应用程序并制作一个服务来下载一些数据。

我想知道我可以在我的服务中动态制作一个按钮吗?

另一个问题是:我能从服务中找到元素(按钮,布局......)吗?

我读到了有关服务的内容并且它说服务是一个程序,它在后台运行在另一个线程中,它没有任何Interactions whit用户。我认为这意味着我们无法创建或找到服务中的任何元素。请让我知道你的意见。谢谢

hi people.
i'm developing an android application & making a "Service" to download Some Data.
i want to know can i make a button Dynamically in my Service ?
another Question is : can i find elements (Button , layouts ...) from Service ?
i read about services and it says "Service" is a programm which runs in Background in a different thread and it doesn't have any Interactions whit user . i think it means we cant Create or find any element in "Service". please let me know your opinion . Thank you

推荐答案

你无法创建。正如服务这个名字所暗示的那样,它会为你提供一些东西。您提供一些输入并要求输出。而已。它无法控制用户界面。
You can't create. As the name "service" suggests, it would serve you something. You provide some input and ask for some output. That's it. It can't control the UI.


这篇关于我可以在服务中制作按钮吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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