1

I have a simple code in which i am reading a pdf filefrom sd card.

Here is my code

In the activity CcActivity: I have given path of the file name,at line number 25:

String filename = "/mnt/sdcard/sample3.pdf";

The pdf is looking fine in emulator. But now i want to set one button and on click event of that button i want to see all the pdf file stored in sd card. I don't have any idea about it,can some one please help me out to solve this problem.

Grant Thomas
  • 44,454
  • 10
  • 85
  • 129
Aamirkhan
  • 5,746
  • 10
  • 47
  • 74

1 Answers1

1

1 Firstly you have to search all pdf files present in sdcard and store it into an array . To find pdf files in sdcard go through link search pdf's.

2 Then show all pdf's from array on any layout you are feasible onclick of button event. After that handle the specific pdf to display in pdfviewer.

Community
  • 1
  • 1
The iCoder
  • 1,414
  • 3
  • 19
  • 39
  • hi! i have try code u have given but when i am calling that function than it shows me force close error.of forse cloase – Aamirkhan Dec 20 '11 at 05:00
  • hi! http://pastebin.com/HrZR3LRe here is my code on click event of button i am calling walkdir(); method at line num:43...when i click on button it shows me force close error – Aamirkhan Dec 20 '11 at 05:12
  • Why you are not giving reference to your button and you are not calling method walkdir(File dir) on button click it is not in your code???. – The iCoder Dec 26 '11 at 13:57