Android:如何在后台启动Activity [英] Android: How to start Activity in background

查看:1751
本文介绍了Android:如何在后台启动Activity的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常,我使用以下代码开始活动:

Usually I start an activity with this code:

Intent i = new Intent(context, MyActivity.class);  
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);  

但是我如何开始活动,使活动留在后台?

But how do I start the activity so that is left in the background?

推荐答案

您应使用服务(用于此目的)-另外类说明.

You should use Services for this - in addition the Class Description.

这篇关于Android:如何在后台启动Activity的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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