Guest User

Untitled

a guest
Mar 22nd, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. context = InstrumentationRegistry.getTargetContext();
  2.  
  3. String filenameOriginal = context.getCacheDir() + "/initial.csv";
  4.  
  5. appsrcandroidTest
  6. └───res
  7. └───raw
  8. v1.csv
  9.  
  10. public static Uri resourceToUri(Context context, int resID)
  11. {
  12. return Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" +
  13. context.getResources().getResourcePackageName(resID) + '/' +
  14. context.getResources().getResourceTypeName(resID) + '/' +
  15. context.getResources().getResourceEntryName(resID));
  16. }
  17.  
  18. resourceToUri(context, R.raw.v1)
  19.  
  20. import com.my_thing.app.my_app.test.R;
  21.  
  22. context = InstrumentationRegistry.getInstrumentation().getContext();
Add Comment
Please, Sign In to add comment