Yes, i can't delete this file from the Android device just because it was assigned to Gdx.audio.newMusic()
If i want to delete the file, generally i can do it safely, but if i assign it via Gdx.audio.newMusic() then i can no longer delete it.
(this is the piece of code working 100%)
public class TEST_Android
{
public static Music M = null;
// *** Test: Delete-file WITHOUT assignment ***
//
public void TEST_A()
{
Gdx.files.local("PurpleRain.ogg").delete(); // work 100%
//
// --- i've checked the file on Android mobile and is NOT present
// --- has been deleted correctly
}
// *** Test: Delete-file AFTER assignment ***
//
public void TEST_B()
{
M = Gdx.audio.newMusic(Gdx.files.local("PurpleRain.ogg")); // work 100%
M.play(); // work 100%
M.stop(); // work 100%
M.delete(); // doesn't work!
//
// --- i've checked the file on Android mobile and is ever present!
// --- not deleted...
}
}
- Aim - i need to delete the file after assignment(in some way)
- Question - how can i delete the file after assigning it to Gdx.audio.newMusic()? Eventually if i had to disconnect it how should i do?
Could you help me please? Thank you all