Android:setcontentview()中的错误;(Android : Error in setcontentview();)
我是android编程的新手,我的布局
setContentView(R.layout.activity_main)
显示错误。 我在resource-> layout
文件夹下有activity_main.xml
。 哪里不对??setContentView(R.layout.activity_main);
I am new to android programming, my layout
setContentView(R.layout.activity_main)
shows error. I have theactivity_main.xml
under theresource-> layout
folder. what is wrong??setContentView(R.layout.activity_main);
原文:https://stackoverflow.com/questions/19947964
最满意答案
如果您有包含您希望使用的类型(类)的源,您可以:
- 创建包含这些类的Java项目
- 创建一个新的UML项目(包含这些类的UML版本)
- 将
modelLibrary
型应用于模型(选择模型,然后单击Stereotypes选项卡上的Apply Stereotypes...
)- 创建一个新的转换配置(Java到UML),并将Java源转换为UML(以Java包为源,UML模型为目标)
然后回到原始的UML模型(要添加类型的模型)
- 右键单击您的UML模型,并将刚刚创建的UML模型项目导入为模型库(
Import Model Library...->Library in Workspace
)- 为属性选择类型时,您现在应该能够搜索并使用Java项目中的类型!
当您将UML模型转换为Java时,它应该使用正确的类型和import语句生成,因此您只需要在构建路径上确保这些类。
If you have the source containing the types (classes) you wish to use you could:
- Create a Java project containing those classes
- Create a new UML project (to contain the UML version of those classes)
- Apply the
modelLibrary
stereotype to the model (select the model, and clickApply Stereotypes...
on the Stereotypes tab)- Create a new transformation configuration (Java to UML), and transform the Java source into UML (with the Java package as the source, and UML model as the target)
Then back in your original UML model (the one where you want to add the types)
- Right-click on your UML model , and import the UML model project you just created as a model library (
Import Model Library...->Library in Workspace
)- When you select a type for an attribute, you should now be able to search and use the types in the Java project!
When you transform your UML model to Java, it should generate with the correct types and import statements, so you'll just have to ensure those classes on the the build path.
相关问答
更多-
软件用英文怎么说[2023-07-22]
software -
RAD是一个基于Eclipse的商业集成开发环境(IDE),由IBM的Rational Software部门开发,用于可视化地设计,构建,测试和部署Web服务,门户和Java EE应用程序。 RSA是一种建模和开发环境,使用统一建模语言(UML)为C ++和Java EE应用程序和Web服务设计架构。 RSA基于Eclipse开放源代码软件框架构建,包括专注于架构代码分析,C ++和模型驱动开发(MDD)的功能,以及用于创建应用程序和Web服务的UML。 RSA包含RAD等所有功能! RAD is a co ...
-
当然,你在调试模式下运行服务器的速度会慢很多,但是你有几个选择,比如把服务器置于开发模式或者对应该启动哪些应用程序做一些微调。 看看这些文章: Rational Application Developer性能提示 - 案例研究:调整WebSphere Application Server V7和V8的性能 性能调优AIX 6.1上的WebSphere Application Server 7 针对急躁的WebSphere调优:如何在20%的努力中获得80%的性能提升 WebSphere Performanc ...
-
点击班级图表背景,然后使用show hide compartment选项。 您需要选择属性和方法隔离区才能以图形方式显示。 上次我评估Rational工具时,它工作得很好。 Click on the class diagram background and then use the show hide compartment option. You have attributes and methods compartments which need to selected in order to be d ...
-
无法启动Rational Software Architect [eclipse](unable to start Rational Software Architect [eclipse])[2023-06-16]
您可能有相同插件的更多版本。 您应该删除旧版本。 也许你可以更轻松地完成一切的干净安装。 You probably have more versions of same plugins. You should remove older versions. Perhaps it get easier for you to do a clean install of everything. -
Preferences > Java > Editor > Save Actions 。 其中一个“附加动作”是“排序成员”。 它会在每次保存后重新组织类成员(如分组的私有字段)。 可能还想查看Java > Code Style > Formatter以查看它是否有帮助。 编辑 :如果您不打算编辑文件但仍想对成员进行排序,可以通过Source > Sort Members...下的Project Explorer上下文菜单来完成。 每次我使用生成的代码时,我都不得不按摩它并假设你也会这样做。 我的错。 Pr ...
-
Rational软件架构师如何将.h和.cpp文件读入新项目(Rational software architect how to read .h and .cpp files into a new project)[2023-07-09]
我找到了答案,右键单击新项目名称,import-> general文件系统。 之前我遇到了问题因为我在寻找C ++选项。 I found the answer, right mouse on the new project name, import-> general file system. I had problems to find it before because I was looking for the C++ options. -
答案似乎归结为两种选择。 使用第三方工具调解流程并进行转换。 基本上还有许多其他工具(例如ToolBus - 这是我发现的唯一一个适用于我的工具),可以将各种应用程序转换为单个通用模型。 从那里它可以导出回任何应用程序。 根据型号,较新版本的SA可以直接导入BPMN模型。 介意这只适用于那些 - 没有别的。 The answer seems to have come down to two options. Use a 3rd party tool to mediate the process, and c ...
-
安装WAS 7服务器适配器 打开IBM Installation Manager。 单击修改图标 在“修改包”屏幕1下; 点击下一步 在“修改包”屏幕2下; 点击下一步 滚动到“服务器工具”; 选择WebSphere Application Server 7.0。 继续完成修改。 现在添加新服务器时,WAS 7应该是一个选项。 Install WAS 7 Server Adapter Open IBM Installation Manager. Click Modify Icon Under "Modify ...
-
如果您有包含您希望使用的类型(类)的源,您可以: 创建包含这些类的Java项目 创建一个新的UML项目(包含这些类的UML版本) 将modelLibrary型应用于模型(选择模型,然后单击Stereotypes选项卡上的Apply Stereotypes... ) 创建一个新的转换配置(Java到UML),并将Java源转换为UML(以Java包为源,UML模型为目标) 然后回到原始的UML模型(要添加类型的模型) 右键单击您的UML模型,并将刚刚创建的UML模型项目导入为模型库( Import Model ...