Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Genymotion VMs display Theme.Holo.DialogWhenLarge-themed activities as normal ones

I'm developing an Android tablet application containing lots of activities that use the Theme.Holo.DialogWhenLarge theme. On real devices (Nexus 7 KitKat and Samsung Galaxy Tab 3 8") these activities are displayed as expected, but on every Genymotion VM I try to create (Nexus 7 KitKat and Nexus 10 Jelly Bean for example) they are displayed as normal full-screen activities. I tested also on a Nexus 7 KitKat emulator created with the standard Android SDK Virtual Device Manager, and activities are displayed as expected.

I can ignore it and suppose that it's only a problem with the Genymotion emulator, but I want to know if there's a way to fix that in order to have a better test environment. I would like to point out that the *-large resource qualifier works on the Genymotion VMs, the issue looks related only to that theme.

To reduce all possible causes of the problem I created a new test project with a normal main activity having a button that launches a DialogWhenLarge-themed activity. I also removed all Android support libraries and all XML styles files automatically created by Eclipse: the only resources left are the two layouts for the activities and the launcher icon. These are all the files of the test project:

src/com/example/testdialogwhenlarge/MainActivity.java

package com.example.testdialogwhenlarge;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

public class MainActivity extends Activity {

    @Override protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {
            @Override public void onClick(View v) {

                // Start the DialogWhenLarge-themed activity
                startActivity(new Intent(MainActivity.this, TestActivity.class));

            }
        });
    }

}

src/com/example/testdialogwhenlarge/TestActivity.java

package com.example.testdialogwhenlarge;

import android.app.Activity;
import android.os.Bundle;

public class TestActivity extends Activity {

    @Override protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test);
    }

}

res/layout/activity_main.xml

<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.testdialogwhenlarge.MainActivity">
    <Button
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Button" />
</FrameLayout>

res/layout/activity_test.xml

<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.testdialogwhenlarge.TestActivity">
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="TextView" />
</FrameLayout>

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.testdialogwhenlarge"
    android:versionCode="1"
    android:versionName="1.0">

    <uses-sdk
        android:minSdkVersion="11"
        android:targetSdkVersion="19" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="TestDialogWhenLarge"
        android:theme="@android:style/Theme.Holo">

        <activity android:name="com.example.testdialogwhenlarge.MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity
            android:name="com.example.testdialogwhenlarge.TestActivity"
            android:theme="@android:style/Theme.Holo.DialogWhenLarge">
        </activity>

    </application>

</manifest>
like image 563
lorenzo-s Avatar asked Nov 11 '22 04:11

lorenzo-s


1 Answers

This issue has been fixed by the Genymotion team in release 2.3.0.

like image 140
eyal-lezmy Avatar answered Nov 15 '22 05:11

eyal-lezmy