Skip to content

Commit c703008

Browse files
authored
Fixing compile error in DeviceCompatibilityModeTestJavaSnippets (#575)
Happened to notice a typo in the file, but it still didn't compile when I fixed the typo, so I made a second fix. The typo was a missing semicolon at the "import AppCompatActivity" line. But after I fixed that, I got an error complaining about `assertFalse(isLetterboxed(activity))` because `isLetterboxed` is expecting an AppCompatActivity but `activity` is a `MainActivity`. Changing `isLetterboxed` fixed the compile error and also meant we don't import AppCompatActivity so the original typo goes away. [shrug emoji] Is this fix okay?
1 parent 1b043a4 commit c703008

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

misc/src/androidTest/java/com/example/snippets/DeviceCompatibilityModeTestJavaSnippets.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.example.snippets;
1818

19-
import androidx.appcompat.app.AppCompatActivity
2019
import androidx.test.core.app.ActivityScenario;
2120
import androidx.test.ext.junit.rules.ActivityScenarioRule;
2221
import org.junit.Rule;
@@ -42,7 +41,7 @@ public void activity_launched_notLetterBoxed() {
4241

4342

4443
// Method used by snippets.
45-
public boolean isLetterboxed(AppCompatActivity activity) {
44+
public boolean isLetterboxed(MainActivity activity) {
4645
return true;
4746
}
4847

0 commit comments

Comments
 (0)