Monday, February 20, 2012

Re: [android-developers] Re: how to create Pdf files from some data

Hi Ankur, try this one
   
Do this one in  onCreate() method   (All the best)
*************************************
   ArrayAdapter<String> adapter;
             ArrayList<String> listItems=new ArrayList<String>();
             File[] imagelist;
             String[] pdflist;
             File images = Environment.getExternalStorageDirectory();  
             imagelist = images.listFiles(new FilenameFilter(){  
                     public boolean accept(File dir, String name)  
                     {  
                             return ((name.endsWith(".pdf")));    
                     }  
             }); 
             pdflist = new String[imagelist.length]; 
             Log.i("RGT"," Size  :"+imagelist.length);
               
             for(int i = 0;i<imagelist.length;i++)
             {
                     pdflist[i] = imagelist[i].getName();
                     Log.i("RGT"," Size  :"+imagelist.length);
             }
             this.setListAdapter(new ArrayAdapter<String>(this,  android.R.layout.simple_list_item_1, pdflist));
}
--

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment