In my manifest I specified (for an entire application) style:
android:theme="@android:style/Theme.NoTitleBar"
Then in my app I want to create a screenshot of the app using drawing cache:
View activityView = getActivity().getWindow().getDecorView().findViewById(android.R.id.content);
activityView.setDrawingCacheEnabled(true);
Bitmap currentScreen = Bitmap.createBitmap(activityView.getDrawingCache());
activityView.setDrawingCacheEnabled(false);
Problem is that on the screenshot there is a gap on top (size of the title bar). I get the right screenshot if title bar is on, or if the app is in the fullscreen mode. I tried to use buildDrawingCache(true), but it made no difference. Any idea how can I can get a "real" screenshot in noTitleBar mode?