-1

someone know why my commands.json file inside raw folder is not known ?

enter image description here

I got cannot resolve symbole 'commands ' I have a few flavours and inside raw folder of each flavor, I have overrode my commands.json file.

Groot
  • 177
  • 1
  • 2
  • 10

1 Answers1

2

try this

InputStream ins = getResources().openRawResource(getResources().getIdentifier(         "commands",          "raw",  getPackageName()));
//                                                                             FILENAME_WITHOUT_EXTENSION          YOUR_PACKAGE_NAME

instead of this

InputStream ins = cx.getResources().openRawResource(R.raw.commands);
Goku
  • 9,102
  • 8
  • 50
  • 81