0

im trying to display items in a list view based on my raw query. Basically when the user click a list item from screen 1, it adds its name as an extra. Then in the next screen im trying to see if my other table in the datbase has any fields with that same name.

table 1 table2 name name

check to see if name(table 1) matches name(table 2)

cant get it to match at all.

any help would be brilliant

1
  • Can you post the code used to put extra and get the value in next screen. I think format of the data is creating problem here. It is not coming out as proper string. Feb 24, 2011 at 13:12

1 Answer 1

0
try{
   File f = new File(Environment.getExternalStorageDirectory()+"/filename.txt");
   fileIS = new FileInputStream(f);
   BufferedReader buf = new BufferedReader(new InputStreamReader(fileIS));
   String readString = new String(); 
   //just reading each line and pass it on the debugger
   while((readString = buf.readLine())!= null){
      Log.d("line: ", readString);
   }
} catch (FileNotFoundException e) {
   e.printStackTrace();
} catch (IOException e){
   e.printStackTrace();
}

This is how you can read the file. Just make a copy of this file and save it to your /data/data/PACKAGE/folder

3
  • ok , that brill, is there any way of doing it so u can actually browse through a pick the file instead of hard code. ta
    – Fizzb89
    Feb 24, 2011 at 14:28
  • Sure, you may use this: openintents.org/en/node/159 . This is, of course, not very comfortable, but it provides you PICK_FILE openintents.org/en/node/164 and PICK_DIRECTORY openintents.org/en/node/165 which is very comfortable and user friendly) To my mind =) Feb 24, 2011 at 14:38
  • No problemz =) The best reward is a plus to post and visiting my blog sometimes..heh. Good luck! Feb 24, 2011 at 14:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.