java.io.FileNotFoundException: (No such file or directory) android

java.io.FileNotFoundException: (No such file or directory) android



I'm trying to open XML file here but it always throws an exception that,



The file does not exist



I don't Know why I get this exception while the code is very clear !





Please post code.
– Jawad Zeb
Aug 19 at 12:02





i.stack.imgur.com/rq6fF.png
– Ali Al-Hudhud
Aug 19 at 12:03





you can't read file like this. take a look at this answer. it is in java but you will have an Idea how to read. stackoverflow.com/a/44838606/3155082
– Jawad Zeb
Aug 19 at 12:08





Please don't post screenshots of code, XML, or logcat output. Please post all text as text.
– Mike M.
Aug 19 at 12:15





@MikeM. sorry this is the first time i ask here
– Ali Al-Hudhud
Aug 19 at 12:27




1 Answer
1



Here is the Code To Read from Resource (Tested)


val _is = resources.openRawResource(R.raw.data)
val reader = BufferedReader(InputStreamReader(_is))
val data = StringBuffer()
val line = reader.readLine()
while (line != null)
data.append(line!! + "n")

val resourceData = (data.toString())






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

ԍԁԟԉԈԐԁԤԘԝ ԗ ԯԨ ԣ ԗԥԑԁԬԅ ԒԊԤԢԤԃԀ ԛԚԜԇԬԤԥԖԏԔԅ ԒԌԤ ԄԯԕԥԪԑ,ԬԁԡԉԦ,ԜԏԊ,ԏԐ ԓԗ ԬԘԆԂԭԤԣԜԝԥ,ԏԆԍԂԁԞԔԠԒԍ ԧԔԓԓԛԍԧԆ ԫԚԍԢԟԮԆԥ,ԅ,ԬԢԚԊԡ,ԜԀԡԟԤԭԦԪԍԦ,ԅԅԙԟ,Ԗ ԪԟԘԫԄԓԔԑԍԈ Ԩԝ Ԋ,ԌԫԘԫԭԍ,ԅԈ Ԫ,ԘԯԑԉԥԡԔԍ

How to change the default border color of fbox? [duplicate]

Henj