java - Getting error on files.readAllLines -


i working in android. reading file content, using method

list<string> lines = files.readalllines(wiki_path); 

but whem using method getting error:

the method readalllines(path) undefined type mediastore.files.

why can compiler not find method?

path wiki_path = paths.get("c:/tutorial/wiki", "wiki.txt");  try {     list<string> lines = files.readalllines(wiki_path);     (string line : lines) {          if(url.contains(line))         {             other.put(tag_title, name);             other.put(tag_url, url);             otherlist.add(other);             break;         }     } } 

the method you're trying use member of java.nio.file.files - class (and indeed package) doesn't exist on android. if java 7 version existed, you're trying use method introduced in java 8. files class you've imported android.provider.mediastore.files entirely different class.

even if compiled, path you're providing looks ever windows path, wouldn't work on android device...


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -