当前位置: 首页 > news >正文

网站着陆页代理公司注册费用

网站着陆页,代理公司注册费用,优秀企业网站的特点,wordpress 网站加密我试图测试Android O Developer Preview的第二阶段。 项目创建后#xff0c;我只是点击了构建并运行但我没有任何成功。Android默认生成的代码如下#xff1a;Toolbar toolbar (Toolbar) findViewById(R.id.toolbar);发生编译错误。Error:(18, 37) error: reference to find…我试图测试Android O Developer Preview的第二阶段。 项目创建后我只是点击了构建并运行但我没有任何成功。Android默认生成的代码如下Toolbar toolbar (Toolbar) findViewById(R.id.toolbar);发生编译错误。Error:(18, 37) error: reference to findViewById is ambiguous both method findViewById(int) in Activity and method findViewById(int) in AppCompatActivity match where T is a type-variable: T extends View declared in method findViewById(int)帮我 我该如何解决这个错误编辑1Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); FloatingActionButton fab (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { Override public void onClick(View view) { Snackbar.make(view, Replace with your own action, Snackbar.LENGTH_LONG) .setAction(Action, null).show(); } }); }编译错误错误(18,27)错误对findViewById的引用不明确Activity中的方法findViewById(int)和AppCompatActivity中的方法findViewById(int)匹配其中T是typesvariablesT extends在方法findViewById(int)中声明的View这不是铸造问题。我的build.gradle就在这里。apply plugin: com.android.application android { compileSdkVersion android-O buildToolsVersion 26.0.0-rc2 defaultConfig { applicationId com.example.app minSdkVersion 16 targetSdkVersion O versionCode 1 versionName 1.0 testInstrumentationRunner android.support.test.runner.AndroidJUnitRunner } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile(proguard-android.txt), proguard-rules.pro } } } dependencies { compile fileTree(dir: libs, include: [*.jar]) androidTestCompile(com.android.support.test.espresso:espresso-core:2.2.2, { exclude group: com.android.support, module: support-annotations }) compile com.android.support:appcompat-v7:26.0.0-beta1 testCompile junit:junit:4.12 compile com.android.support.constraint:constraint-layout:1.0.2 compile com.android.support:design:26.0.0-beta1 }我尝试了Android Oreo Developer Preview 2.并使用Android Studio 3.0 Canary版。你的build.gradle看起来不错但是编译器似乎仍然需要使用supportLib 26来编译旧的compileSdkVersion (25或更低版本)。尝试同步gradle和Build- Clean Project 。 如果这没有帮助 File- Invalidate Cache / Restart应该做的事情……findViewById的方法签名随着API级别25的引入而改变以支持generics并删除丑陋的转换新方法签名public T findViewById (int id);与旧的相比public View findViewById(int id);因此将您的代码更改为Toolbar toolbar findViewById(R.id.toolbar);参考 查看| Android开发人员当我的compileSdkVersion为27并且buildToolsVersion不是27时我遇到了同样的问题。将它们更改为compileSdkVersion 27 buildToolsVersion“27.0.0”我认为当buildToolsVersion比compileSdkVersion更旧时会发生这种情况。我相信他们改变了findViewById的方法签名这样你就不再需要强制转换了。 尝试将该行代码更改为Toolbar toolbar findViewById(R.id.toolbar);
http://www.yutouwan.com/news/115860/

相关文章:

  • 郑州网站快速制作漂亮的html页面源码
  • 企业网站策划书1000字国外网站空间租用费用
  • 汕头网页设计网站方案谷歌seo外贸推广
  • 动态图网站怎么做dw网页升级紧急通知写作
  • 网站建设能用手机制作吗网站建设这门课
  • 个人主页网站设计代码婚庆5个坑
  • 夜夜做新郎网站开发软件需要什么
  • 天猫商城入口如何搭建 seo网站
  • 怎么建设网站zy258h5个人页面制作
  • 定制高端网站建设如果你会建网站
  • 天水市秦州区作风建设年网站大气的公司名称大全
  • 东莞没有网站的公司网站建设 徐州
  • 网站建设具体详细过程网站制作东莞
  • 东莞数据线厂家东莞网站建设sem可以为网站建设做什么
  • 网站建设怎么跑业务手机网站qq登录插件
  • 织梦网站搜索怎么做网站开发投标文件
  • 大连企业网站网页设计及讲解多少钱
  • 电子通讯录网站建设北京今天的最新发布消息
  • 企业建设网站的主要目的淘宝下载安装
  • 网站规划与建设规划书超级外链自动发布工具
  • 北京网站建设免费网站一级a做爰在免费线看
  • 网站模板的缺点织梦汽车网站模板
  • 建设集团有限公司网站网站投入费用
  • 网站 做实名认证吗网站 手机 app
  • 内江市网站建设python 手机网站开发
  • 如何判断网站是否被k易语言 网站开发
  • 网站建设招标无锡建设网站成都
  • 上海网站排名团队logo设计在线生成免费影子
  • 西安知名的集团门户网站建设公司杭州网站建设培训班
  • 建设行业网站价格创建网店需要wordpress