我是安卓初学者,没有安卓手机。
我正在创建一个包含 2 个屏幕的 android 应用程序。当我在第二个屏幕时,我需要知道如何返回。我是否必须在 xml 文件中专门编写一个按钮并对其进行编码,或者用户可以单击手机的后退按钮返回吗? (没有任何代码)否则,用户可以将它滑到左侧,所以它会回来吗? (没有任何代码)。
请帮忙
最佳答案
can the user click the phone's back button to come back? (without any code)
是的。所有 Android 手机都为此目的实现了后退按钮。
Do I have to specifically program a button in the xml file and code it
你不必这样做,但这是可能的(尽管在大多数情况下不推荐)
Or else, can the user slide it to the left side, so it will come back? (without any code).
通常没有。也许如果你使用一种特殊的布局/Activity 来支持它作为内置功能。不过,我不知道有任何实现此功能的。
关于java - 移动到上一个屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14461777/