Skip to content Skip to sidebar Skip to footer

Breaking Large Text Into Pages In Android Text Switcher Or View Flipper

I am in the process of developing an e-book reader application for android 3.0 tablets. To begin with I have a large chunk of String data. I want to split/break that String into pa

Solution 1:

This is all you need to make your code work.

    DisplayMetrics dm = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(dm);
    int screenWidth = dm.widthPixels;
    int screenHeight= dm.heightPixels;

Replace your following code block with mine. It will work.

Display display = getWindowManager().getDefaultDisplay(); 
int screenWidth = display.getWidth();
int screenHeight = display.getHeight();

Post a Comment for "Breaking Large Text Into Pages In Android Text Switcher Or View Flipper"