Обновление Android до SDK 27 черный экран без ошибок - PullRequest
0 голосов
/ 01 июня 2018

Я обновил свое приложение с SDK 22 до 27, и на каждом экране, где я использую свой собственный вид (GLSurfaceView), экран просто становится черным.без ошибок, только черный.Это настольная игра с плитками, которые вы можете перемещать, поэтому в этом представлении много рисованных элементов.Итак, вот мое мнение:

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="match_parent"
    style="@style/AppTheme">

    <my.custom.app.view.BoardView
        android:id="@+id/game_board_view"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"/>
</LinearLayout>

и класс

public class BoardView extends GLSurfaceView implements SurfaceHolder.Callback, View.OnTouchListener {
  public BoardView(Context context, AttributeSet attrs) {
    super(context, attrs);
    parameters = new BoardLookAndFeel();
    TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.BoardView);

    typedArray.recycle();
    getHolder().addCallback(this);
    setOnTouchListener(this);
  }
  ....
}

style.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
  <style name="AppTheme" parent="android:Theme.Holo.Light">
    <item name="android:background">#ffffff</item>
    <item name="android:textColor">#000000</item>
    <item name="android:actionMenuTextColor">#000000</item>
    <item name="android:actionBarStyle">@style/AppTheme.ActionBar</item>
  </style>

  <style name="TutorialContent" parent="android:TextAppearance.DeviceDefault">
    <item name="android:layout_width">fill_parent</item>
    <item name="android:layout_height">wrap_content</item>
    <item name="android:lineSpacingMultiplier">1.2</item>
  </style>

  <style name="Buttons">
    <item name="android:background">@null</item>
    <item name="android:textColor">#007AFF</item>
  </style>

  <dimen name="default_margin">20dp</dimen>
  <dimen name="default_font_size">16sp</dimen>

  <!-- Border related styles -->
  <color name="board_background">#b52809</color>
  <color name="board_row_color">#ffffff</color>
  <dimen name="board_border_size">1dp</dimen> <!-- A good border size is a multiple of 3 -->
  <dimen name="board_border_size2">1dp</dimen> <!-- A good border size is a multiple of 3 -->

  <!-- Field related styles -->
  <color name="field_background">#848484</color>
  <color name="field_alternate_background">#ffffff</color>
  <dimen name="field_margin">1.5dp</dimen>
  <dimen name="field_margin2">0dp</dimen>

  <!-- Token related styles -->
  <color name="token_background">#000000</color>
  <color name="token_shadow">#50000000</color>
  <array name="token_colors">
    <item>#b52809</item> <!-- Red -->
    <item>#249f0e</item> <!-- Green -->
    <item>#12a9c7</item> <!-- Blue -->
    <item>#794c98</item> <!-- Violet -->
    <item>#ddcb00</item> <!-- Yellow -->
    <item>#ee5f00</item> <!-- Orange -->
  </array>
  <array name="arrow_colors">
    <item>#F90504</item> <!-- Red -->
    <item>#048005</item> <!-- Green -->
    <item>#050580</item> <!-- Blue -->
    <item>#919D2D</item> <!-- orange -->
  </array>
  <dimen name="token_shadow_distance">3dp</dimen>
  <dimen name="token_margin">2dp</dimen>
  <dimen name="token_border_size">3dp</dimen>
  <dimen name="token_shadow_offset">2dp</dimen>
  <item name="token_on_touch_zoom_factor" format="float" type="dimen">1.4</item>
</resources>

Я потерялся без сообщения об ошибке ...Почему он не отображает вид?Это может быть проблема с памятью?

...