简体   繁体   English

如何添加我在 setcontentview() 函数中创建的 xml 文件

[英]How do I add an xml file that I created in the setcontentview() function

我在我的 android 项目中创建了一个名为calc.xmlxml文件,但我无法在setcontentview()函数中提供我的xml文件必须做什么?

Normally this is the way:通常是这样的:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.calc);
}

Post some code please, if your problem is still there.如果您的问题仍然存在,请发布一些代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何添加到我在Android应用程序上创建的文件? - How do I add to the file i created on my android app? 如何在扩展View的类中设置ContentView? (Android,Java) - How do I setContentView in a class that extends View? (Android, Java) 如何使由setContentView()设置的textview(具有透明背景)中的“文本”显示在activity.xml中的布局上方? - How do I make a “text” from textview(with a transparent background) set by setContentView( ) be displayed above my layout in activity.xml? setContentView xml 文件错误 - setContentView xml file error 如何将单词从文本文件添加到我创建的数组中? - How do I add words from an text file to an array i created? 如何删除FileOutputStream创建的文件 - How do I delete file created by FileOutputStream 如何将我创建的类的实例添加到MultipartEntity? - How do I add an Instance of a class I created to a MultipartEntity? 如何在另一个按钮内部创建的按钮上添加功能? - How do I add a function to a button that is being created inside another button? 如何将通过方法创建的JPanels添加到cardLayout.add(); - How do I add JPanels, created by methods, to cardLayout.add(); 如何在片段中使用setContentView方法? - How can i use setContentView method in fragment?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM