Hi I have created a folder in sd card holding a db as below
public Databasehandler(Context context)
{
//super(context, DATABASE_NAME, null, DATABASE_VERSION);
super(context, Environment.getExternalStorageDirectory()+ File.separator + "MyAppFolder"+ "/"+DATABASE_NAME, null, DATABASE_VERSION);
}
Now, I am trying to hide this file so that it is not accesible. I tried the below code.
final String NOMEDIA_FILE = ".nomedia";
path = new File(Environment.getExternalStorageDirectory().getAbsolutePath()+ File.separator + "MyAppFolder" );
path.mkdirs();
file= new File(path,NOMEDIA_FILE);
if (!file.exists())
{
try
{
file.createNewFile();
Log.e("NOMEDIA_FILE"," ");
}
catch (IOException e)
{
e.printStackTrace();
}
}
But, this is not working. Not sure how to hide the file in SDcard . Please Help. Thanks!