Snippet content is not displayed on the handset

I am trying to get my fragment to appear on my mobile, but for some reason it won't do it. However, when loading the same thing onto a tablet, it looks like normal. Anyone what's wrong with my code and how to fix this issue? All related help would be appreciated.

Class references

FragmentWCLine.java

WCBankActivity.java

FragmentWCBank.java

WCBankViewPagerAdapter.java

Links to layouts

fragment_wc_line.xml

fragment_wc_bank.xml

+3


source to share


3 answers


As FragmentWCBank

you have to use a dispatcher subsidiaries fragments.



adapter =  new WCBankViewPagerAdapter(getChildFragmentManager(), Numboftabs, getActivity());

      

+1


source


Please make sure that you have not designed the layout in landscape mode for Android phones, then the question arises how to control in tablets.

Place this boolean resource in res / values ​​as bools.xml or whatever (filenames don't matter here):

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <bool name="portrait_only">true</bool>
</resources>

      

Place this in res / values-sw600dp and res / values-xlarge:



 <?xml version="1.0" encoding="utf-8"?>
<resources>
    <bool name="portrait_only">false</bool>
</resources>

      

Then on the java side check a condition like

if(getResources().getBoolean(R.bool.portrait_only)){
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}

      

-1


source


Can you include XML files, this issue is due to screen resolution, so you need to create separate XML files for different screens to set up screen compatibility.

-2


source







All Articles