android - java.lang.IllegalArgumentException: contains a path separator -


i have filename in code :

string name_of_file="//sdcard//imageq.png"; fileinputstream fis =this.openfileinput(name_of_file); // 2nd line 

i error on 2nd line :

05-11 16:49:06.355: error/androidruntime(4570): caused by: java.lang.illegalargumentexception: file //sdcard//imageq.png contains path separator

i tried format also:

string name_of_file="/sdcard/imageq.png"; 

this method opens file in private data area of application. cannot open files in subdirectories in area or entirely other areas using method. use constructor of fileinputstream directly pass path directory in it.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -