コード例 #1
0
  protected void loadPhotos() {

    List<IndexDetails> values;
    values = db.getAllComments();

    for (int i = 0; i < values.size(); i++) {
      // listFile[i] = new File(values.get(i).getPath());
      System.out.print(
          "Path Fragment: " + values.get(i).getPath() + " Date: " + values.get(i).getDate());
      Photo toAdd = new Photo(Uri.parse(values.get(i).getPath()));
      mPhotos.add(toAdd);
    }

    db.close();
    /*File file= new File(android.os.Environment.getExternalStorageDirectory(),"BestPhotoNowFavorites");

    if (file.isDirectory())
    {
        listFile = file.listFiles();


        for (int i = 0; i < listFile.length; i++)
        {
        	Photo toAdd = new Photo(Uri.fromFile(listFile[i]));
        	System.out.println("Uri path: "+Uri.fromFile(listFile[i]));
        	mPhotos.add(toAdd);
        }

    }*/

  }
コード例 #2
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mPhotos = new ArrayList<Photo>();
    db = new IndexDetailsDataSource(getActivity());
    db.open();
    loadPhotos();
  }