Skip to content

androidx.appcompat.app.AppCompatActivityThe typo was in line 19: #578

@jessore7400kabir-gif

Description

@jessore7400kabir-gif

The typo was in line 19:
https://github.com/android/snippets/blob/main/misc/src/androidTest/java/com/example/snippets/DeviceCompatibilityModeTestJavaSnippets.java#L19

import androidx.appcompat.app.AppCompatActivity
import androidx.test.core.app.ActivityScenario;
import androidx.test.ext.junit.rules.ActivityScenarioRule;

(note the lack of a semicolon at the end of the first line).

But when I fixed that typo, the file still wouldn't compile, because isLetterBoxed() expects to be passed an AppCompatActivity but it's actually being passed a MainActivity.

When I changed the isLetterBoxed method to be passed a MainActivity, everything compiles -- but since the file no longer needs AppCompatActivity, AndroidStudio removed that "import AppCompatActivity" line, so the typo fix went away.

...just to confirm, when you submitted it, did you compile the AndroidTest module? I don't see how it could have compiled with that missing semicolon.

Originally posted by @asolovay in #575 (comment)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions