Answer the question
In order to leave comments, you need to log in
How to keep text formatting in TextView?
<resources>
<string name="app_name">CodeSampler</string>
<string name="CreateFile">\n
import java.io.File;\n
import java.io.IOException;\n
\n
public class CreateFileExample{\n
public static void main( String[] args ){\n
try {\n
\n
File file = new File("c:\\newfile.txt");\n
\n
if (file.createNewFile()){\n
System.out.println("File is created!");\n
}else{\n
System.out.println("File already exists.");\n
}\n
\n
} catch (IOException e) {\n
e.printStackTrace();\n
}\n
}\n
}\n</string>
</resources>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question