Preview is not showing for some activity

201 views Asked by At

Preview is not showing for some XML files in android studio but the application works fine. In order to develop my application, I need to be able to see all preview properly

I've read several posts in StackOverflow I change style, sdk ,but it doesn't work any way

Here are some rendering error android studio gave me

java.lang.IllegalArgumentException: java.lang.ClassCastException@53dcf95b java.lang.IllegalArgumentException: java.lang.ClassCastException@24df40fa java.lang.IllegalArgumentException: java.lang.ClassCastException@269b81fb

2

There are 2 answers

0
Shahadat Hossain On

You may try some options:

  • Clean Project
  • Rebuild Project
  • Invalidate caches / Restart
  • Switching Multiple time Text / Design [Answerd by @Rajkumar Sharma]
  • Change API level
  • Change Theme
  • You may close your current project and Open another new to test that the problem is in your current project or in the Android Studio.
  • Check Manifest
0
Rajkumar Sharma On

For me I switching to text to design again and again. And sometime switching to preview and gradle at the right corner. This does the trick. Hope it help you