问题描述
你是如何处理在Android应用程序的多个屏幕?我已经与在没有问题底部的标签栏,但我所想要做的是与我在项目中创建一个新的.xml布局文件中的内容替换所有屏幕上的内容。此外,我怎么会绑在后端code到新的布局文件?我敢肯定,这个问题可能已经存在并且是googleable(可能已作出了一个新词)。但是,我不知道它到底是什么,我期待的。在此先感谢您的帮助。
How do you handle multiple screens in an android application? I have developed with the tab bar at the bottom without problem, however what I am wanting to do is replace all the content on the screen with the content from a new .xml layout file I have created in the project. Additionally, how would I tie the back end code to the new layout file? I'm sure this question probably exists already and is googleable (may have made up a new word). However, I don't know exactly what it is that I am looking for. Thanks in advance for your help.
推荐答案
您需要做的是,创建一个新的活动,并把它添加到AndroidManifest.xml中:
What you need to do is, create a new Activity and add it to the AndroidManifest.xml:
<activity android:name="ActivityClassName" android:label="Label for the Activity"></activity>
和可调用的方法:
public void startActivity() {
Intent someName = new Intent(CurrentClass.this, ActivityClassName.class);
startActivity(someName);
}
这篇关于Android的多屏应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!