Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

竖屏转换为横屏后,报资源找不到错误 #83

Open
charles-yinyu opened this issue Dec 28, 2022 · 1 comment
Open

竖屏转换为横屏后,报资源找不到错误 #83

charles-yinyu opened this issue Dec 28, 2022 · 1 comment

Comments

@charles-yinyu
Copy link

Activity为竖屏配置,通过代码动态切换为横屏,随后发起资源访问,报No package ID 6e found for ID 0x6e090027。同时抛出异常:
android.content.res.Resources$NotFoundException: Unable to find resource ID #0x6e0a0005

`public class JavaSampleActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_java_sample);
    ButterKnife.bind(this);

    View view = getWindow().getDecorView();
    view.postDelayed(() -> {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

        view.post(() -> {
            getLayoutInflater().inflate(R.layout.sample, null);
        });
    }, 0);
}

}`

@mcxinyu
Copy link

mcxinyu commented Dec 31, 2022

你有没有试过在不用 qigsaw 的项目中,这样做会不会报错呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants