I'm getting this error log from google and I don't know what's causing it. This resource is in the folder that it says that it's not. I have never ran into this error myself. Here's the error:
android.content.res.Resources$NotFoundException: File res/drawable-mdpi/notebook_ul.jpg from drawable resource ID #0x7f020090
at android.content.res.Resources.loadDrawable(Resources.java:1714)
at android.content.res.Resources.getDrawable(Resources.java:581)
at android.view.View.setBackgroundResource(View.java:7391)
at com.bfreq.dice.fragments.SettingsFrag.onCreateView(SettingsFrag.java:76)
..............................
Caused by: java.lang.NullPointerException.........
Here's me calling the resource in my fragment
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// TODO Auto-generated method stub
View v = inflater.inflate(R.layout.settings, container, false);
// Initializing Background
rLayout = (RelativeLayout) v.findViewById(R.id.relativeLayout_Settings);
switch (background) {
case 0:
rLayout.setBackgroundResource(R.drawable.clay_ul);
break;
case 1:
rLayout.setBackgroundResource(R.drawable.parchment_ul);
break;
case 2:
rLayout.setBackgroundResource(R.drawable.brownpaper_ul);
break;
case 3:
rLayout.setBackgroundResource(R.drawable.notebook_ul);
break;
case 4:
rLayout.setBackgroundColor(Color.WHITE);
break;
}
........
return v;
}
I Also call it from a method. Now I know that I'm not suppose to talk directly from one fragment to another but it's been working with no problem and haven't had time to rewrite everything.
public void setBackground() {
switch (background) {
case 0:
SettingsFrag.rLayout.setBackgroundResource(R.drawable.clay_ul);
DiceFrag.rLayout.setBackgroundResource(R.drawable.clay_uc);
DiceLogFrag.rLayout.setBackgroundResource(R.drawable.clay_ur);
break;
case 1:
SettingsFrag.rLayout.setBackgroundResource(R.drawable.parchment_ul);
DiceFrag.rLayout.setBackgroundResource(R.drawable.parchment_uc);
DiceLogFrag.rLayout.setBackgroundResource(R.drawable.parchment_ur);
break;
case 2:
SettingsFrag.rLayout.setBackgroundResource(R.drawable.brownpaper_ul);
DiceFrag.rLayout.setBackgroundResource(R.drawable.brownpaper_uc);
DiceLogFrag.rLayout.setBackgroundResource(R.drawable.brownpaper_ur);
break;
case 3:
SettingsFrag.rLayout.setBackgroundResource(R.drawable.notebook_ul);
DiceFrag.rLayout.setBackgroundResource(R.drawable.notebook_uc);
DiceLogFrag.rLayout.setBackgroundResource(R.drawable.notebook_ur);
break;
case 4:
SettingsFrag.rLayout.setBackgroundColor(Color.WHITE);
DiceFrag.rLayout.setBackgroundColor(Color.WHITE);
DiceLogFrag.rLayout.setBackgroundColor(Color.WHITE);
break;
}
}
I make sure whenever I call that method that it won't return a null pointer. Any ideas would be great. I can also put more code up if someone wants to see it. Thanks!