My code works on small devices but its not working on large screen devices above 5' inch

StackOverflow https://stackoverflow.com/questions/20628055

  •  02-09-2022
  •  | 
  •  

Pergunta

My code works on small devices but it doesn't work on large screen devices above 5 inches.

The layout folders structure is the following:

layout-land/homeactivity.xml
layout-small-land/homeactivity.xml
layout-large-land/homeactivity.xml
layout-xlarge-land/homeactivity.xml

And the exception is:

12-17 12:26:10.811: E/AndroidRuntime(335): FATAL EXCEPTION: main 
12-17 12:26:10.811: E/AndroidRuntime(335): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pelkin.peekzoo/com.pelkin.peekzoo.Animals}: android.view.InflateException: Binary XML file line #22: Error inflating class 
12-17 12:26:10.811: E/AndroidRuntime(335): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647) 
12-17 12:26:10.811: E/AndroidRuntime(335): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
Foi útil?

Solução

Check all ids of every view in all xml. It should be same in all xml files.

Outras dicas

Did you have all of the images you use in all different sizes? If you're missing icons or images in the bigger sizes: drawable-xxhdpi and drawable-xhdpi, this might give you a nullpointer. Since it is trying to load an image wich doesn't exist in that size.

the ID might be different in layout-large-land/homeactivity.xml or layout-xlarge-land/homeactivity.xml of the layout. double check your id's.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top