4

I using gridview with scroll horizontal include 5 1 row, 5 column display data and using code set weight, height for it:

int widthCell = getActivity().getResources().getDimensionPixelSize(R.dimen.widthCell);
int heightCell = getActivity().getResources().getDimensionPixelSize(R.dimen.heightCell);

But for phone samsum or oppo failed: "Resource ID #0x7f0600c3 type #0x4 is not valid". I don't know how to fix this error. Can you help me? Thanks

2 Answers2

1

Inside your values.xml file please check if you have dp in the value for example:

Is correct:

<dimen name="some_width">350dp</dimen>

without dp is wrong:

<dimen name="some_width">350</dimen>

Arlind Hajredinaj
  • 8,380
  • 3
  • 30
  • 45
0
<resources>  <dimen name="custom_marker_image">50dp</dimen>   <dimen name="custom_marker_padding">2dp</dimen>
<resources/>

So, go to res > values > dimensions.xml and right there include this code.

Gaurav Mall
  • 2,372
  • 1
  • 17
  • 33