Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Ewout ter Hoeven
VLC-Android
Commits
17005dc8
Commit
17005dc8
authored
Aug 21, 2014
by
Edward Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BrowserActivity: verify against adding invalid directories
parent
bf845dfb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
vlc-android/res/values/strings.xml
vlc-android/res/values/strings.xml
+1
-0
vlc-android/src/org/videolan/vlc/gui/BrowserActivity.java
vlc-android/src/org/videolan/vlc/gui/BrowserActivity.java
+9
-1
No files found.
vlc-android/res/values/strings.xml
View file @
17005dc8
...
...
@@ -86,6 +86,7 @@
<string
name=
"mediafiles"
>
Media files
</string>
<string
name=
"notavailable"
>
not available
</string>
<string
name=
"nosubdirectory"
>
No subdirectories.
</string>
<string
name=
"directorynotfound"
>
The directory path \'%1$s\' was not found.
</string>
<string
name=
"nohistory"
>
You have no playback history yet.
</string>
<string
name=
"validation"
>
Are you sure?
</string>
...
...
vlc-android/src/org/videolan/vlc/gui/BrowserActivity.java
View file @
17005dc8
...
...
@@ -51,6 +51,7 @@ import android.view.View;
import
android.widget.AdapterView.AdapterContextMenuInfo
;
import
android.widget.EditText
;
import
android.widget.ListView
;
import
android.widget.Toast
;
public
class
BrowserActivity
extends
ListActivity
{
public
final
static
String
TAG
=
"VLC/BrowserActivity"
;
...
...
@@ -192,7 +193,14 @@ public class BrowserActivity extends ListActivity {
b
.
setPositiveButton
(
R
.
string
.
ok
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
CustomDirectories
.
addCustomDirectory
(
input
.
getText
().
toString
());
String
path
=
input
.
getText
().
toString
().
trim
();
File
f
=
new
File
(
path
);
if
(!
f
.
exists
()
||
!
f
.
isDirectory
())
{
Toast
.
makeText
(
BrowserActivity
.
this
,
getString
(
R
.
string
.
directorynotfound
,
path
),
Toast
.
LENGTH_SHORT
).
show
();
return
;
}
CustomDirectories
.
addCustomDirectory
(
f
.
getAbsolutePath
());
refresh
();
}
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment