Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

read file from android !! doesn't work for me

the program can't read the file ? and don't show err , this is my code what the problem about it

int na; ArrayList ar = new ArrayList();

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Resources s = getResources();
    File  f = new File("dat.csv");
    BufferedReader bu;
    try {
        bu = new BufferedReader(new FileReader("//raw/dat.cav"));
        String st ;
        while((st= bu.readLine()) != null){
            for(int i=0 ; i<ar.size();i++){
                ar.add(i,bu.readLine());
            }


        }

    } catch (IOException e) {
        e.printStackTrace();
    }


}

public void show(View view) {
    Toast.makeText(getBaseContext(),ar.indexOf(0),Toast.LENGTH_LONG).show();
}

}

Comments