1

getAssets() showing error in eclipse

view story
linux-howto

http://stackoverflow.com – I'm trying to be able to search for a string in a file in the assets folder. the getassets().open is saying its undefined. I read somewhere this way works. Here is my code: import java.io.File; import java.util.Scanner; import android.content.Context; import android.util.Log; public class Search { public static void LoadStuff(String Name) { Scanner reader = null; try { reader = new Scanner(new File(getAssets().open("myFile.txt"))); } catch (Exception e) { Log.d("damn", "FAIL"); } if(reader != null) Load (HowTos)