AndroidStudio icon indicating copy to clipboard operation
AndroidStudio copied to clipboard

switch case error

Open actor20170211030627 opened this issue 4 years ago • 0 comments

//code example(代码示例):
public static final String PACKAGE_NAME = getAppPackageName();
public static final String ACTION_START = "abc_" + PACKAGE_NAME;
public void testSwitchCase(String action) {
    switch(action) {
        case ACTION_START://提示错误(Prompt Error): "Constant expression required" !!!!!
            break;
        default:
            break;
    }
}
public static String getAppPackageName() {
    return "com.github";
}

the picture blow: ↓ 111

actor20170211030627 avatar Mar 16 '21 10:03 actor20170211030627