2

I am making an app in Android but when launch the second activity in my app, it gives Resources$NotFoundException at the setContentView(int) method. I have made sure that I have typed the correct resource layout id and the resource id shown in the error is also present in the R.java file with the correct resource. I have also tried cleaning the project and also restarting eclipse multiple times. The error still stays. Please help.

My Activity File

Activity File

Layout File

Layout File

The Error in LogCat

Logcat Error

R.java

R.java

CodePro_NotYet
  • 621
  • 6
  • 17

1 Answers1

2

Try to put your activity_single_player_add_bet layout xml in another folder (layout instead of layout-land).

See more here: Providing Alternative Resources and How to Support Multiple Screens

Update:

For getting layout in landscape orientation you have to change AndroidManifest.xml:

android:screenOrientation="landscape"  

Details:

Community
  • 1
  • 1
Yehor Nemov
  • 907
  • 2
  • 16
  • 31
  • It runs now but in portrait mode. I want it to run in landscape mode. – CodePro_NotYet Jul 03 '14 at 14:01
  • It's reachable. Simple set the layout orientation to HORIZONTAL (`android:orientation="horizontal"`) in **activity_single_player_add_bet.xml**. – Yehor Nemov Jul 03 '14 at 14:06
  • Where do I put this attribute? I can't put it in any element of the layout as they will have their own interpretation of the attribute, like `LinearLayout` will make its own orientation horizontal rather than the activity. – CodePro_NotYet Jul 03 '14 at 14:11