问题描述
您好所有:我创建中,我使用的菜单每一个屏幕,为用户导航的应用程序。在我的应用程序,我有屏蔽1 - >之际,主屏幕时,在用户登录画面2 - >用户进入该屏幕来执行某些操作。现在,在画面2我想有菜单选项,让用户去主屏幕。但开始的活动,我们做
Hello All:I am creating an application in which I am using menus on every screen for the user to navigate. In my application, I have Screen1--> comes as home screen when the user logs inScreen2--> user goes to this screen to perform some operations. Now on Screen2 I want to have menu option to let the user go to home screen.But to start the activity we do
startActivity(new Intent(Home.this, Screen2.class));
不过,我想用这是当所用的登入,然后使用onresume方法我可以更新主屏幕上创建的现有主屏幕。
But, I want to use the existing home screen which was created when the used logged in and then using onresume method I can update the home screen.
谁能告诉我如何利用现有的意图或活动提供菜单选项?谢谢Ashwani
Can anybody please tell me how to use the existing intents or activity to provide menu options?ThanksAshwani
推荐答案
Ashwani,
我相信这可以用 <$完成C $ C> setFlags() 上打电话给你的意图
使用 FLAG_ACTIVITY_REORDER_TO_FRONT
标志。如果屏幕1仍然存在,将其带到前台。该文件似乎并没有规定,但我相信它启动屏幕1的一个新的活动被杀害了。
I believe this can be done with a setFlags()
call on your Intent
using the FLAG_ACTIVITY_REORDER_TO_FRONT
flag. If screen 1 still exists it will bring it to the foreground. The documentation doesn't seem to specify, but I assume it launches a new Activity of Screen 1 was killed.
这篇关于如何重复使用Android的意图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!