Android AVD does not display multiple panels

I study multilevel applications and launch the Master / Detail Flow application, which is configured by Android Studio when creating a new project (and select this option). According to the comments in the Google code that is being created, the application should be displayed in multi-level mode for devices with large-format layouts. The problem I am facing is that no matter which AVD I use, I only get one window. Firstly, here is the onCreate method of the main activity. Please note that this code comes directly from Google (this is not my code):

protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_item_list); if (findViewById(R.id.item_detail_container) != null) { // The detail container view will be present only in the // large-screen layouts (res/values-large and // res/values-sw600dp). If this view is present, then the // activity should be in two-pane mode. mTwoPane = true; // In two-pane mode, list items should be given the // 'activated' state when touched. ((ItemListFragment) getFragmentManager() .findFragmentById(R.id.item_list)) .setActivateOnItemClick(true); } // TODO: If exposing deep links into your app, handle intents here. } 

According to Android Developer docs , running this code on a device with a dp of at least 640dp x 480dp is large enough to qualify as a large screen and, apparently, will be displayed in multi-level mode. I am using AVD to simulate a Nexus 10 API 19 device that has 800dp x 1280: xhdpi. Here is some more info: enter image description here

This is what I get when I run this. Obviously, multiple windows are not displayed: enter image description here What do I need to do to display multiple panels? When I run this on a USB-connected device, it works fine, so the code is accurate. The question should be AVD, which I use? Thanks!

+6
source share
1 answer

I had the same problem: edit your AVD, go to advanced settings, then do not select the skin in the "Custom skin definition" field.

+5
source

Source: https://habr.com/ru/post/982341/


All Articles