suryann / android-file-dialog Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/android-file-dialog
Automatically exported from code.google.com/p/android-file-dialog
[deleted issue]
When I call this dialog, I can see the 'location' path on the top of the screen
but all files are shown as "false". What am I doing wrong? Thanks!
Original issue reported on code.google.com by [email protected]
on 27 Sep 2011 at 8:22
I have implemented these funcionalities.
You can pass a parameter to the activity to make it show only files whose
extension matches a list of extensions.
Also you can select a directory.
Im sorry for portuguese comments I left in the code.. Feel free to remove it.
I have edited the code in Linux, Im sorry for any encoding issue.
Thanks man!
Original issue reported on code.google.com by [email protected]
on 19 Oct 2011 at 4:19
Attachments:
What steps will reproduce the problem?
1. open the filedialog with the START_PATH: /
2. select a directory, such as /etc
3. rotate the screen, the loacation come back to START_PATH
What is the expected output? What do you see instead?
The location should keep the same when the screen was rotated.
I see the loaction come back to START_PATH instead.
What version of the product are you using? On what operating system?
I found this problem in android 2.1, 2.2
Please provide any additional information below.
to fix this problem, the onPause method should be overrided.
@Override
protected void onPause() {
String myPathStr = myPath.getText().toString();
int idx = myPathStr.lastIndexOf(':');
String currPath = myPathStr.substring(idx + 2);
getIntent().putExtra(START_PATH, currPath);
super.onPause();
}
Original issue reported on code.google.com by [email protected]
on 1 Aug 2011 at 12:49
Added the last visited path to the return data.
This makes it easier to use the START_PATH option.
in onActivityResult()
lastPath = data.getStringExtra(FileDialog.RESULT_FOLDER)
Original issue reported on code.google.com by [email protected]
on 10 Feb 2012 at 3:16
Attachments:
I've increased some padding around the file and folder items so they don't look
as squashed.
The padding size has also been changed to use "sp" rather than "dp", as SP is
scaled depending on the screen density/size and also the user settings (ie.
font size "bigger", etc)
Original issue reported on code.google.com by [email protected]
on 10 Feb 2012 at 8:31
.
Original issue reported on code.google.com by [email protected]
on 16 Feb 2011 at 8:16
At least with Android 2.2, f.listFiles() returns null if there are no child
files in the selected directory (for example "/sdcard" on the emulator.
So (File file : files) will fail with a NullPointerException in this case. You
could add before a guard like:
if (files != null) ...
Then the dialog will work OK. I don't know if the origin of this problem is an
issue in Android 2.2 or just a protection worth to be added to the dialog.
In Java listFiles() returns an empty list (not null) if there is nothing in the
directory, but I don't know if the "/sdcard" path exist on the emulator by
default.
Original issue reported on code.google.com by [email protected]
on 4 Aug 2011 at 8:49
File dialog crashes with NullPointerException if dirPath does not exists.
03-10 18:15:17.289: ERROR/AndroidRuntime(1438): Caused by:
java.lang.NullPointerException
03-10 18:15:17.289: ERROR/AndroidRuntime(1438): at
com.loudsoft.loudbook.FileDialog.getDirImpl(FileDialog.java:177)
03-10 18:15:17.289: ERROR/AndroidRuntime(1438): at
com.loudsoft.loudbook.FileDialog.getDir(FileDialog.java:137)
03-10 18:15:17.289: ERROR/AndroidRuntime(1438): at
com.loudsoft.loudbook.FileDialog.onCreate(FileDialog.java:125)
03-10 18:15:17.289: ERROR/AndroidRuntime(1438): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-10 18:15:17.289: ERROR/AndroidRuntime(1438): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
I offer this solution:
private void getDirImpl(String dirPath) {
File f = new File(dirPath);
// Use root directory if dirPath does not exists
if(!f.exists())
{
Toast.makeText(context, "There is no such directory " + dirPath, duration).show();
dirPath = root;
f = new File(root);
}
myPath.setText(getText(R.string.location) + ": " + dirPath);
currentPath = dirPath;
item = new ArrayList<String>();
path = new ArrayList<String>();
mList = new ArrayList<HashMap<String, Object>>();
File[] files = f.listFiles();
Такие дела =)
Original issue reported on code.google.com by [email protected]
on 10 Mar 2011 at 3:31
I've created a patch which uses the option "OPTION_CURRENT_PATH_IN_TITLEBAR",
which allows you to hide the "myPath" view and use the activity titlebar
instead.
usage:
chooseFile = new Intent(this.getBaseContext(), FileDialog.class);
chooseFile.putExtra(FileDialog.OPTION_CURRENT_PATH_IN_TITLEBAR, true);
startActivityForResult(chooseFile, ACTIVITY_CHOOSE_FILE);
Original issue reported on code.google.com by [email protected]
on 10 Feb 2012 at 8:36
Attachments:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.