It's throwing an error because your're trying save the file in a directory that does not exist. I ran your code and using a breakpoint I check the value in the String fileName
.
From the screen shot below you can see that it is an invalid directory and there's where the problem is. You might want to change the directory.
[EDIT]
Change the way you're setting the name of the file.
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
Date now = new Date();
fileName = formatter.format(now) + "-" + userinputResult;
saveFile(fileName);
Now, fileName
will have current date + the user entered text.
For instance, the file name will be 2013-12-26-18-51-26-hello.txt
Also, make sure you've added the permission <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />