mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 13:45:35 +03:00
Merge pull request #686 from tobiasKaminsky/bugfixMultipleSelect
Bugfix multiple select
This commit is contained in:
commit
945c584f34
1 changed files with 9 additions and 6 deletions
|
@ -18,6 +18,7 @@
|
|||
package com.owncloud.android.ui.fragment;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
|
@ -209,16 +210,18 @@ public class LocalFileListFragment extends ExtendedListFragment {
|
|||
* @return File paths to the files checked by the user.
|
||||
*/
|
||||
public String[] getCheckedFilePaths() {
|
||||
String [] result = null;
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
SparseBooleanArray positions = mList.getCheckedItemPositions();
|
||||
if (positions.size() > 0) {
|
||||
Log_OC.d(TAG, "Returning " + positions.size() + " selected files");
|
||||
result = new String[positions.size()];
|
||||
for (int i=0; i<positions.size(); i++) {
|
||||
result[i] = ((File) mList.getItemAtPosition(positions.keyAt(i))).getAbsolutePath();
|
||||
for (int i = 0; i < positions.size(); i++) {
|
||||
if (positions.get(positions.keyAt(i)) == true) {
|
||||
result.add(((File) mList.getItemAtPosition(positions.keyAt(i))).getAbsolutePath());
|
||||
}
|
||||
}
|
||||
|
||||
Log_OC.d(TAG, "Returning " + result.size() + " selected files");
|
||||
}
|
||||
return result;
|
||||
return result.toArray(new String[result.size()]);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue