I used the code layout.setbackgroundresource(R.drawable.image) in on create method to set background image of layout. But when i try to run on device it stopped working with