Which part of Android is in charge of picking a correct resource profile?

后端 未结 3 902
执念已碎
执念已碎 2021-01-12 04:44

I have a weird problem.

Before you come to an idea to lash out on me, I am working on a custom Jelly Bean. Therefore the \"usual nice approaches\" might not work her

3条回答
  •  一生所求
    2021-01-12 04:56

    I don't know if i get you right, you are building a custom AndroidOS and you want this custom AndroidOS to always load the same layout resource, in your case layout-large-xhdpi?

    If so, i think you have customize the Configuration Class. If you want it quick and dirty, you could maybe override the int-Constants on line 72 and below.

    Concrete, change:

    ....
    100     public static final int SCREENLAYOUT_SIZE_LARGE = 0x03;
    108     public static final int SCREENLAYOUT_SIZE_XLARGE = 0x04;
    

    to:

    ....
    100     public static final int SCREENLAYOUT_SIZE_LARGE = 0x04;
    108     public static final int SCREENLAYOUT_SIZE_XLARGE = 0x04;
    

    Other way could be to override the Constructor and the setToDefaults()-Method so it always loads the same screenlayout.

    I didn't tried it out, I do not know if it is working, and I have no credible and/or official sources (Excluded offical Android Code), but i hope i could help you.

提交回复
热议问题