android - 创建的 Android 虚拟设备不显示

标签 android android-layout android-studio avd

我在 Android Studio 中创建了一个 AVD,但是当我转到布局->activity_main.xml 时它没有显示。错误信息如下所示。

Failed to create Context 0x3005
could not get wglGetExtensionsStringARB
emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
could not get wglGetExtensionsStringARB
could not get wglGetExtensionsStringARB
could not get wglGetExtensionsStringARB
could not get wglGetExtensionsStringARB
could not get wglGetExtensionsStringARB
could not get wglGetExtensionsStringARB
could not get wglGetExtensionsStringARB
emulator: emulator window was out of view and was recentered
Could not initialize emulated framebuffer

activity_main.xml下有两个文件:activity_main.xmlactivity_main.xml(land)。在右侧的组件树和属性空间下,它显示“nothing to show”。

当我尝试渲染它时,它显示此错误消息:

渲染问题在渲染过程中引发异常:action_bar

xml 文件如下所示:

<RelativeLayout 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" 
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"    
    tools:context=".MainActivity">

    <TextView android:text="@string/hello_world"      
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

</RelativeLayout>

有什么想法吗?

最佳答案

哦,我想出了问题。在 IDE 中渲染布局时,我将 Android 版本更改为用户,从最佳选择到版本 21,它位于显示框上方的 AppTheme 和 MainActivity 旁边。

enter image description here

关于android - 创建的 Android 虚拟设备不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29024321/

相关文章:

android - 防止Android Studio重新格式化JAVA代码

android - 使用 Gradle 测试 Android 库

未找到 Android 和 Google 客户端 API NetHttptransport 类

java - 当其他方法调用时,createImage 在 Android 中返回不可变位图?

java - Android 设置 View 位置 - setY 与 setTop

android - 在约束布局中切换链组的可见性

java - 在类或方法中放置变量的最佳位置 (Android Studio)

android - 如何抑制由未能生成的类引起的代码生成错误?

java - Android反编译的.class文件不显示相应.java文件的所有方法

android - 将右引力设置为 ProgressDialog 内的消息