从另一个活动中打开一个活动的片段 [英] Open a fragment of an activity from another activity

查看:72
本文介绍了从另一个活动中打开一个活动的片段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好我想从我的应用程序中打开设置"的文本转语音输出"片段.我认为首先我需要打开设置活动,然后打开其片段.我尝试设置ComponentName,但无法找到活动.

Hi All I want to open the "Text-To-Speech output" fragment of Settings from my application. I think first I need to open the settings activity and then its fragment. I tried setting the ComponentName but it was unable to locate the activity.

我应该使用FragmentManager;我找不到适合自己需求的任何东西.有人可以给我一些可以很好解释的链接.

Should I use FragmentManager; I couldn't find anything specific to my needs. Can somebody give me some link which might explain it well.

推荐答案

您可以使用以下内容:

Intent ttsSettings = new Intent("com.android.settings.TTS_SETTINGS");
ttsSettings.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(ttsSettings);

这篇关于从另一个活动中打开一个活动的片段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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