Android应用程序返回上一屏幕 [英] Android application going back to previous screen

查看:169
本文介绍了Android应用程序返回上一屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Everyone

开发包含多个XML文件的应用程序。当我从服务器接收特定命令时,基于我将使用以下命令调用所需的XML文件:



setContentView(R.layout.xml_file1);

setContentView(R.layout.xml_file2);



,这从xml_file1移动到xml_file2 ......但我无法回到之前屏幕即xml_file1(其当前屏幕)......是否正确使用上述命令调用xml文件???

如果没有请建议我正确的命令....并且还要回到上一个屏幕.....请帮助

Hello Everyone
Am developing an application with multiple XML files. When I receive particular commands from server, based on that i will be calling the required XML files using the command:

setContentView(R.layout.xml_file1);
setContentView(R.layout.xml_file2);

and this moves from xml_file1 to xml_file2...but I am unable to come back to previous screen ie xml_file1(its present screen)......whether is t correct to call xml file using the above mentioned command???
If not please suggest me the correct command....and also move back to the previous screen.....please help

推荐答案

Android使用Intent在活动之间转换,请参阅以下示例:

simple-example-for-intent-and-bundle [ ^ ]

<小时ef =https://thenewcircle.com/s/post/65/example_using_intent> example_using_intent [ ^ ]
Android uses Intent to transit between activities, see these examples :
simple-example-for-intent-and-bundle[^]
example_using_intent[^]


这篇关于Android应用程序返回上一屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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