首页 > 解决方案 > 我开发了一个应用程序,它可以完美地从 API 18 运行到 28,但它在 API 26 以下崩溃我不明白如何解决这个问题

问题描述

这在 logcat 1 中有错误]:https ://i.stack.imgur.com/m5nOz.png 程序流程从 splash--->player--->MainActivity 开始,还有一个关于应用程序的活动,请帮帮我。 Splash.xml 主要包含错误!。

    <?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".splash">

    <ProgressBar
        android:id="@+id/progressBar"
        style="?android:attr/progressBarStyle"
        android:layout_width="103dp"
        android:layout_height="76dp"
        android:layout_marginStart="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginBottom="216dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

    <ImageView
        android:id="@+id/imageView7"
        android:layout_width="183dp"
        android:layout_height="158dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="92dp"
        android:layout_marginEnd="8dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:srcCompat="@drawable/t1" />

    <TextView
        android:id="@+id/textView7"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginTop="268dp"
        android:layout_marginEnd="8dp"
        android:fontFamily="@font/aldrich"
        android:text="TIC TAC TOE"
        android:textColor="@color/colorPrimaryDark"
        android:textSize="30sp"
        android:textStyle="bold"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.497"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</android.support.constraint.ConstraintLayout>

飞溅.java

package com.vishwas.tictactoe;

import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Handler;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class splash extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        if (!isConnected(splash.this)) buildDialog(splash.this).show();
        else {


            Handler handler = new Handler();
            handler.postDelayed(new Runnable() {
                @Override
                public void run() {
                    startActivity(new Intent(splash.this, player.class));
                    finish();
                }
            }, 4100);


        }

    }

    public boolean isConnected(Context context) {
        ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo netinfo = cm.getActiveNetworkInfo();

        if (netinfo != null && netinfo.isConnectedOrConnecting()) {
            android.net.NetworkInfo wifi = cm.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
            android.net.NetworkInfo mobile = cm.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);

            if ((mobile != null && mobile.isConnectedOrConnecting()) || (wifi != null && wifi.isConnectedOrConnecting())) {
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    }

    public AlertDialog.Builder buildDialog(Context c) {
        AlertDialog.Builder builder = new AlertDialog.Builder(c);
        builder.setTitle("No Internet Connection!");
        builder.setMessage("You need to have internet connection to play this game.\n Press Ok to Exit!");

        builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                finish();
            }
        }).setCancelable(false);
        return builder;
    }

}

Actvity_player.xml 它也包含错误,但现在它消失了

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorPrimaryDark"
    tools:context=".player">

    <Button
        android:id="@+id/abtapp2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentStart="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentEnd="true"
        android:layout_alignParentRight="true"
        android:layout_marginStart="71dp"
        android:layout_marginTop="8dp"
        android:layout_marginEnd="68dp"
        android:layout_marginBottom="8dp"
        android:background="@drawable/bt_mainback"
        android:onClick="abt"
        android:text="About App"
        android:textAllCaps="true"
        android:textStyle="bold"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.468"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/imageButton5" />

    <com.google.android.gms.ads.AdView
        android:id="@+id/adView3"
        android:layout_width="match_parent"
        android:layout_height="74dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:layout_marginEnd="8dp"
        app:adSize="BANNER"
        app:adUnitId="ca-app-pub-7866343935318771/3173472761"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <EditText
        android:id="@+id/editText4"
        android:layout_width="250dp"
        android:layout_height="47dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="364dp"
        android:layout_marginEnd="8dp"
        android:background="@drawable/roundedcornersedittext"
        android:ems="10"
        android:inputType="textPersonName"
        android:padding="5dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.489"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginTop="316dp"
        android:layout_marginEnd="8dp"
        android:text="Enter Name Of Player 2:"
        android:textColor="@color/textcolor"
        android:textSize="24sp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.514"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginTop="168dp"
        android:layout_marginEnd="8dp"
        android:text="Enter Name Of Player 1:"
        android:textColor="@color/textcolor"
        android:textSize="24sp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <EditText
        android:id="@+id/editText"
        android:layout_width="250dp"
        android:layout_height="47dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="212dp"
        android:layout_marginEnd="8dp"
        android:background="@drawable/roundedcornersedittext"
        android:ems="10"
        android:inputType="textPersonName"
        android:padding="5dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <ImageButton
        android:id="@+id/imageButton5"
        android:layout_width="80dp"
        android:layout_height="52dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginBottom="72dp"
        android:background="@color/colorPrimaryDark"
        android:onClick="pass"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.498"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/editText4"
        app:layout_constraintVertical_bias="0.706"
        app:srcCompat="@drawable/arr" />

</android.support.constraint.ConstraintLayout>

播放器.java

package com.vishwas.tictactoe;

import android.content.DialogInterface;
import android.content.Intent;
import android.media.Image;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageButton;

import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdSize;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.MobileAds;

public class player extends AppCompatActivity {
private AdView myAdView;
private EditText et1;
    private EditText et2;
private ImageButton ibt1;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_player);
        // Sample AdMob app ID: ca-app-pub-7866343935318771~9805549476 banner2
        MobileAds.initialize(this, "ca-app-pub-7866343935318771~9805549476");
        AdView adView = new AdView(this);
        adView.setAdSize(AdSize.BANNER);
        adView.setAdUnitId("ca-app-pub-7866343935318771/3173472761");
        myAdView = findViewById(R.id.adView3);
        AdRequest adRequest = new AdRequest.Builder().build();
        myAdView.loadAd(adRequest);
        //
        et1 = findViewById(R.id.editText);
        et2 = findViewById(R.id.editText4);
        ibt1 = findViewById(R.id.imageButton5);
    }

    public void pass(View view)
    {
        if(et1.getText().toString().equals(et2.getText().toString()))
        {
            AlertDialog.Builder builder = new AlertDialog.Builder(player.this);
            builder.setMessage("Both Name can't be equal!!!").setPositiveButton("Ok", null);
            AlertDialog alert = builder.create();
            alert.show();
        }
        else
        {
            Intent intent = new Intent(this, MainActivity.class);
            String p1 = et1.getText().toString();
            String p2 = et2.getText().toString();
            intent.putExtra("player1", p1);
            intent.putExtra("player2", p2);
            startActivity(intent);
        }
    }

    @Override
    public void onBackPressed()
    {
        AlertDialog.Builder builder = new AlertDialog.Builder(player.this);
        builder.setMessage("Do you really want to Exit?").setPositiveButton("Ok", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which)
            {
                player.super.onBackPressed();
            }
        }).setNegativeButton("Cancel",null).setCancelable(false);
        AlertDialog alert = builder.create();
        alert.show();
    }

    public void abt(View view)
    {
        startActivity(new Intent(this,about.class));
    }
}

activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/bkcolor"
    android:orientation="vertical"
    tools:context=".MainActivity">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="64dp">

        <TextView
            android:id="@+id/text_view_p1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentStart="true"
            android:layout_marginStart="47dp"
            android:freezesText="true"
            android:textColor="@color/colorPrimaryDark"
            android:textSize="18sp"
            android:textStyle="bold" />

        <TextView
            android:id="@+id/text_view_p2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/text_view_p1"
            android:layout_alignParentStart="true"
            android:layout_marginStart="47dp"
            android:layout_marginTop="2dp"
            android:freezesText="true"
            android:textColor="@color/colorPrimaryDark"
            android:textSize="18sp"
            android:textStyle="bold" />

        <Button
            android:id="@+id/button_reset"
            android:layout_width="116dp"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:layout_centerVertical="true"
            android:layout_marginEnd="5dp"
            android:background="@drawable/bt_mainback"
            android:text="reset"
            android:textStyle="bold" />

    </RelativeLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="121dp"
        android:layout_weight="1">

        <Button
            android:id="@+id/button_00"
            android:layout_width="0dp"
            android:layout_height="180dp"
            android:layout_margin="2dp"
            android:layout_weight="1"
            android:background="@color/colorPrimaryDark"
            android:freezesText="true"
            android:textColor="@color/textcolor"
            android:textSize="60sp" />

        <Button
            android:id="@+id/button_01"
            android:layout_width="0dp"
            android:layout_height="180dp"
            android:layout_margin="2dp"
            android:layout_weight="1"
            android:background="@color/colorPrimaryDark"
            android:freezesText="true"
            android:textColor="@color/textcolor"
            android:textSize="60sp" />

        <Button
            android:id="@+id/button_02"
            android:layout_width="0dp"
            android:layout_height="180dp"
            android:layout_margin="2dp"
            android:layout_weight="1"
            android:background="@color/colorPrimaryDark"
            android:freezesText="true"
            android:textColor="@color/textcolor"
            android:textSize="60sp" />

    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="123dp"
        android:layout_weight="1">

        <Button
            android:id="@+id/button_10"
            android:layout_width="0dp"
            android:layout_height="180dp"
            android:layout_margin="2dp"
            android:layout_weight="1"
            android:background="@color/colorPrimaryDark"
            android:freezesText="true"
            android:textColor="@color/textcolor"
            android:textSize="60sp" />

        <Button
            android:id="@+id/button_11"
            android:layout_width="0dp"
            android:layout_height="180dp"
            android:layout_margin="2dp"
            android:layout_weight="1"
            android:background="@color/colorPrimaryDark"
            android:freezesText="true"
            android:textColor="@color/textcolor"
            android:textSize="60sp" />

        <Button
            android:id="@+id/button_12"
            android:layout_width="0dp"
            android:layout_height="180dp"
            android:layout_margin="2dp"
            android:layout_weight="1"
            android:background="@color/colorPrimaryDark"
            android:freezesText="true"
            android:textColor="@color/textcolor"
            android:textSize="60sp" />

    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="138dp"
        android:layout_weight="1">

        <Button
            android:id="@+id/button_20"
            android:layout_width="0dp"
            android:layout_height="180dp"
            android:layout_margin="2dp"
            android:layout_weight="1"
            android:background="@color/colorPrimaryDark"
            android:freezesText="true"
            android:textColor="@color/textcolor"
            android:textSize="60sp" />

        <Button
            android:id="@+id/button_21"
            android:layout_width="0dp"
            android:layout_height="180dp"
            android:layout_margin="2dp"
            android:layout_weight="1"
            android:background="@color/colorPrimaryDark"
            android:freezesText="true"
            android:textColor="@color/textcolor"
            android:textSize="60sp" />

        <Button
            android:id="@+id/button_22"
            android:layout_width="0dp"
            android:layout_height="180dp"
            android:layout_margin="2dp"
            android:layout_weight="1"
            android:background="@color/colorPrimaryDark"
            android:freezesText="true"
            android:textColor="@color/textcolor"
            android:textSize="60sp" />
    </LinearLayout>

    <com.google.android.gms.ads.AdView xmlns:ads="http://schemas.android.com/apk/res-auto"
        android:id="@+id/adView"
        android:layout_width="match_parent"
        android:layout_height="74dp"
        ads:adSize="BANNER"
        ads:adUnitId="ca-app-pub-7866343935318771/5991207790" />


</LinearLayout>

MainActivity.java

package com.vishwas.tictactoe;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdSize;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.InterstitialAd;
import com.google.android.gms.ads.MobileAds;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    private AdView myAdView;
    private InterstitialAd mInterstitialAd;
    private final Button[][] buttons = new Button[3][3];

    private boolean player1Turn = true;

    private int roundCount;

    String p1up;
    String p2up;
    String p1;
    String p2;

    public int player1Points;
    public int player2Points;

    public TextView textViewPlayer1;
    public TextView textViewPlayer2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        textViewPlayer1 = findViewById(R.id.text_view_p1);
        textViewPlayer2 = findViewById(R.id.text_view_p2);

        Intent intent = getIntent();
         p1 = intent.getStringExtra("player1");
         p2 = intent.getStringExtra("player2");

        textViewPlayer1.setText(p1+":");
        textViewPlayer2.setText(p2+":");

        // Sample AdMob app ID:ca-app-pub-7866343935318771~9805549476 banner1
        MobileAds.initialize(this, "ca-app-pub-7866343935318771~9805549476");
        AdView adView = new AdView(this);
        adView.setAdSize(AdSize.BANNER);
        adView.setAdUnitId("ca-app-pub-7866343935318771/5991207790");
        myAdView = findViewById(R.id.adView);
        AdRequest adRequest = new AdRequest.Builder().build();
        myAdView.loadAd(adRequest);
        // Sample AdMob app ID: ca-app-pub-7866343935318771~9805549476 InterstitialAd
        mInterstitialAd = new InterstitialAd(this);
        mInterstitialAd.setAdUnitId("ca-app-pub-7866343935318771/4056746387");
        mInterstitialAd.loadAd(new AdRequest.Builder().build());
        mInterstitialAd.setAdListener(new  AdListener() {
            @Override
            public void onAdClosed() {
                // Load the next interstitial.
                mInterstitialAd.loadAd(new AdRequest.Builder().build());
            }

        });
        //

        //



        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                String buttonID = "button_" + i + j;
                int resID = getResources().getIdentifier(buttonID, "id", getPackageName());
                buttons[i][j] = findViewById(resID);
                buttons[i][j].setOnClickListener(this);
            }
        }

        Button buttonReset = findViewById(R.id.button_reset);
        buttonReset.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                resetGame();
                if (mInterstitialAd.isLoaded()) {
                    mInterstitialAd.show();
                } else {
                    Log.d("TAG", "The interstitial wasn't loaded yet.");
                }
            }
        });
    }

    @Override
    public void onClick(View v) {
        if (!((Button) v).getText().toString().equals("")) {
            return;
        }

        if (player1Turn) {
            ((Button) v).setText("X");
        } else {
            ((Button) v).setText("O");
        }

        roundCount++;

        if (checkForWin()) {
            if (player1Turn) {
                player1Wins();
            } else {
                player2Wins();
            }
        } else if (roundCount == 9) {
            draw();
        } else {
            player1Turn = !player1Turn;
        }

    }

    private boolean checkForWin() {
        String[][] field = new String[3][3];

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                field[i][j] = buttons[i][j].getText().toString();
            }
        }

        for (int i = 0; i < 3; i++) {
            if (field[i][0].equals(field[i][1])
                    && field[i][0].equals(field[i][2])
                    && !field[i][0].equals("")) {
                return true;
            }
        }

        for (int i = 0; i < 3; i++) {
            if (field[0][i].equals(field[1][i])
                    && field[0][i].equals(field[2][i])
                    && !field[0][i].equals("")) {
                return true;
            }
        }

        if (field[0][0].equals(field[1][1])
                && field[0][0].equals(field[2][2])
                && !field[0][0].equals("")) {
            return true;
        }

        if (field[0][2].equals(field[1][1])
                && field[0][2].equals(field[2][0])
                && !field[0][2].equals("")) {
            return true;
        }

        return false;
    }

    public void player1Wins() {
        player1Points++;
        Toast.makeText(this, p1+"wins!", Toast.LENGTH_SHORT).show();
        p1up = String.valueOf(player1Points);
        updatePointsText();
        resetBoard();
    }

    public void player2Wins() {
        player2Points++;
        Toast.makeText(this, p2+"wins!", Toast.LENGTH_SHORT).show();
        p2up = String.valueOf(player2Points);
        updatePointsText();
        resetBoard();
    }

    public void draw() {
        Toast.makeText(this, "Draw!", Toast.LENGTH_SHORT).show();
        resetBoard();
    }

    public void updatePointsText() {
        textViewPlayer1.setText(p1+":"+p1up);
        textViewPlayer2.setText(p2+":"+p2up);
    }

    private void resetBoard() {
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                buttons[i][j].setText("");
            }
        }

        roundCount = 0;
        player1Turn = true;
    }

    private void resetGame() {
        player1Points = 0;
        player2Points = 0;
        p1up="0";
        p2up="0";
        updatePointsText();
        resetBoard();
    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);

        outState.putInt("roundCount", roundCount);
        outState.putInt("player1Points", player1Points);
        outState.putInt("player2Points", player2Points);
        outState.putBoolean("player1Turn", player1Turn);
    }

    @Override
    protected void onRestoreInstanceState(Bundle savedInstanceState) {
        super.onRestoreInstanceState(savedInstanceState);

        roundCount = savedInstanceState.getInt("roundCount");
        player1Points = savedInstanceState.getInt("player1Points");
        player2Points = savedInstanceState.getInt("player2Points");
        player1Turn = savedInstanceState.getBoolean("player1Turn");
    }

}

> here is the about app activity file which i think that is not creating any error
  > This app runs perfectly on Nougat and Android Pie but it does crashes when it is un on APi Level less than 26 Though the min sdk is 18 and max is 28 

这个应用程序是关于井字游戏的,问题是当安装应用程序并单击它时,应用程序崩溃并且无法在 Marshmallow 中打开,但它在大于 25 的 Api 上运行良好

标签: androidxmlandroid-layout

解决方案


但是当我运行你的代码时,应用程序在棒棒糖和棉花糖版本上都运行良好。

您可以在错误图像中看到错误原因显示为“膨胀问题”。意味着 imageview 无法膨胀提供的图像。

注意:- 在 activity_splash.xml

您在 imageview 中使用app:srcCompat属性,但仅在棒棒糖 android 版本之后才支持。因此,如果您的应用程序针对 api 版本 18 到 28,那么这将不会在 api 21(棒棒糖)下运行。

解决方案:-

首先尝试替换app:srcCompat="@drawable/t1"android:src="@drawable/t1"

如果此解决方案不起作用,请检查您的应用程序 gradle 中的构建版本、编译版本目标版本。

活动飞溅——

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".Splash">

    <ProgressBar
        android:id="@+id/progressBar"
        style="?android:attr/progressBarStyle"
        android:layout_width="103dp"
        android:layout_height="76dp"
        android:layout_marginStart="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginBottom="216dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

    <ImageView
        android:id="@+id/imageView7"
        android:layout_width="183dp"
        android:layout_height="158dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="92dp"
        android:layout_marginEnd="8dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        android:src="@drawable/ic_launcher_background" />

    <TextView
        android:id="@+id/textView7"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginTop="268dp"
        android:layout_marginEnd="8dp"
        android:text="TIC TAC TOE"
        android:textColor="#00a4e4"
        android:textSize="30sp"
        android:textStyle="bold"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.497"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</android.support.constraint.ConstraintLayout>

推荐阅读