summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Cook <nickcook@google.com>2019-07-18 22:27:08 +0000
committerNick Cook <nickcook@google.com>2019-08-20 00:45:50 +0000
commitf767eb4aa92dd6b4a864ed4e46dba63f75e41338 (patch)
tree64228ce1e504bcdf09b0b94dbad413640fe1ec57
parent36de3020693a9aa8304f145fed957d2a6824085e (diff)
downloadandroid_development-f767eb4aa92dd6b4a864ed4e46dba63f75e41338.tar.gz
android_development-f767eb4aa92dd6b4a864ed4e46dba63f75e41338.tar.bz2
android_development-f767eb4aa92dd6b4a864ed4e46dba63f75e41338.zip
docs: Fix outdated sample code in Context#getExternalFilesDir.
Test: make ds-docs Bug: 129290716 Change-Id: I0b1c1d9222c96c6bb2777f58d273546c81d77eb2
-rw-r--r--samples/ApiDemos/src/com/example/android/apis/content/ExternalStorage.java9
1 files changed, 2 insertions, 7 deletions
diff --git a/samples/ApiDemos/src/com/example/android/apis/content/ExternalStorage.java b/samples/ApiDemos/src/com/example/android/apis/content/ExternalStorage.java
index 534a1c822..b76d1b42a 100644
--- a/samples/ApiDemos/src/com/example/android/apis/content/ExternalStorage.java
+++ b/samples/ApiDemos/src/com/example/android/apis/content/ExternalStorage.java
@@ -339,19 +339,14 @@ public class ExternalStorage extends Activity {
// Get path for the file on external storage. If external
// storage is not currently mounted this will fail.
File file = new File(getExternalFilesDir(null), "DemoFile.jpg");
- if (file != null) {
- file.delete();
- }
+ file.delete();
}
boolean hasExternalStoragePrivateFile() {
// Get path for the file on external storage. If external
// storage is not currently mounted this will fail.
File file = new File(getExternalFilesDir(null), "DemoFile.jpg");
- if (file != null) {
- return file.exists();
- }
- return false;
+ return file.exists();
}
// END_INCLUDE(private_file)