简体   繁体   中英

I am having a problem with setContentView() method in android

Whenever I create a new activity there is an error with name like for eg. setContentView(R.layout.activity_display_image);

and i am getting this错误信息

invalidate cache from file section of android studio, clean and build app. this will solve your problem

Follow these three steps:

  1. Android Studio > Build > Clean Project

  2. Android Studio > Build > Rebuild Project

  3. Android Studio > File > Invalidate Caches/Restart > Invalidate and Restart

If still you face this problem then do Sync Project with Gradle File by pressing the following button. Hope this will work now.

使用 Gradle 按钮同步项目

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM