android studio 读写文件操作(应用场景三)

news2024/12/12 5:38:31

android studio版本:2023.3.1 patch2

例程:filesaveandread

其实我写这个都是我记录我要做后个数独小游戏,每一个都是为了解决一个问题。即是分享也是备忘,反正我什么都不会,就是一顿瞎改,不行就研究。这个应用场景三就是我这个小游戏的一部分。先看图:

我本来要实现的功能是:退出的时候自动保存退出时玩的状态,再打开的时候自动读取,这样就不会丢失上次玩的进度。 上图的读取和写入,本来是别的功能,现在临时做为读写功能。

这个游戏除了按钮外一共有90个textview,上面的81个为显示和解答数独题目用的,下面蓝色的9个数字为填写用的。这里仅仅是为了演示读写功能,所以很多功能没有写进来,不能解题也不能填写数字,textview的text都是事先设置好的。

关键代码就是读的部分:

    private void readFileAndSplit(){
        File file =new File(getFilesDir(),"10000.txt");//这个必须单独写,不能直接写到try里面,不知道为啥。
        try(BufferedReader reader=new BufferedReader(new FileReader(file))){
            String line=reader.readLine();//读取行
            String[] parts=line.split(",");//split按照“,”分割,并写进part1数组
            int b=0;//计数,为了同步设置textviews里面81个textview.
            for(String a :parts){
                textViews[b].setText(a);//同步修改相应位置textview的text.
                b+=1;//计数加1
            }
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

这部分代码没使用filehelper.java代码,那个代码好像实现不了,反正我不会,但"写"还是用了那个代码。

题外:其实在这个游戏里面,解题的时候原来的数字是不能修改的,只有空白的地方才可以修改。但上面parts数组除了数字以外的地方本来应该是空值,我想的是,parts数组本来就是string,所以解析出来肯定是个空值嘛(“”),实际不是,即不是空值也不是null,更不是数字。

写入文件的的数据是这样:

但解析完成赋值给textview的text后,这个值非空,在游戏的逻辑里面就无法编辑,游戏就没法玩了。所以我在实际的游戏的代码里是这样的。

try{
                    int num=Integer.parseInt(a);
                    textViews[b].setText(a);
                    b+=1;
                } catch (NumberFormatException e) {
                    textViews[b].setText("");
                    b+=1;
                }

我把parts里面的值解析出来后,把它转成整形数值,那个所谓的空值会出错,利用这个错误把空白的地方的text强制赋值空字符串(“”),在游戏里就正常了。

所以:字符串数组里面的“空值”,即不是"",也不是null,到底是啥?有懂的大婶麻烦指明。谢谢!

经过一天的学习,根据原因虽然还不知道,但找到了解决办法。在游戏里有一个需要判断两个textview的text是否相同的情况,之前使用的是textview1.gettext()==textview2.gettext()来判断,即使text相同,比较结果也是false。简单说原因是==比较的是地址,所以改成textview1.gettext().tostring().equals(textview2.gettext().tostring())就没问题了。equals()比较的是值 。

下面是代码,里面有很多没用的代码,而且这是个未完工的游戏,仅供参考。屎山代码,大婶勿喷。

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">


        <TextView
            android:id="@+id/textView"

            android:layout_width="405dp"
            android:layout_height="405dp"
            android:layout_marginTop="100dp"
            android:background="#CDE3ED"
            android:text=""
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <TextView
            android:id="@+id/textView11"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="110dp"
            android:background="#FFff3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"

            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />

        <TextView
            android:id="@+id/textView12"
            android:layout_width="35dp"
            android:layout_height="35dp"
            android:layout_marginStart="8dp"
            android:layout_marginTop="110dp"
            android:background="#FFff3B"
            android:gravity="center"

            android:textAlignment="center"
            android:textSize="25sp"

            app:autoSizeTextType="none"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView11"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />

        <TextView
            android:id="@+id/textView13"
            android:layout_width="35dp"
            android:layout_height="35dp"
            android:layout_marginStart="3dp"
            android:layout_marginTop="110dp"
            android:background="#FFFF3B"
            android:gravity="center"

            android:textAlignment="center"
            android:textSize="25sp"

            app:autoSizeTextType="none"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.02"
            app:layout_constraintStart_toEndOf="@+id/textView12"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />

        <TextView
            android:id="@+id/textView14"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="11dp"
            android:layout_marginTop="110dp"
            android:background="#FFFF3B"
            android:gravity="center"

            android:textAlignment="center"
            android:textSize="25sp"

            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView13"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />

        <TextView
            android:id="@+id/textView15"
            android:layout_width="35dp"
            android:layout_height="35dp"
            android:layout_marginTop="110dp"
            android:layout_marginStart="8dp"
            android:background="#FFFF3B"
            android:gravity="center"

            android:textAlignment="center"
            android:textSize="25sp"

            app:autoSizeTextType="none"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView14"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />

        <TextView
            android:id="@+id/textView16"
            android:layout_width="35dp"
            android:layout_height="35dp"
            android:layout_marginStart="8dp"
            android:layout_marginTop="110dp"
            android:background="#FFFF3B"
            android:gravity="center"

            android:textAlignment="center"
            android:textSize="25sp"

            app:autoSizeTextType="none"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView15"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />

        <TextView
            android:id="@+id/textView17"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="11dp"
            android:layout_marginTop="110dp"
            android:background="#FFFF3B"
            android:gravity="center"

            android:textAlignment="center"
            android:textSize="25sp"

            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView16"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />

        <TextView
            android:id="@+id/textView18"
            android:layout_width="35dp"
            android:layout_height="35dp"
            android:layout_marginStart="8dp"
            android:layout_marginTop="110dp"
            android:background="#FFFF3B"
            android:gravity="center"

            android:textAlignment="center"
            android:textSize="25sp"

            app:autoSizeTextType="none"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView17"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />

        <TextView
            android:id="@+id/textView19"
            android:layout_width="35dp"
            android:layout_height="35dp"
            android:layout_marginStart="8dp"
            android:layout_marginTop="110dp"
            android:background="#FFFF3B"
            android:gravity="center"

            android:textAlignment="center"
            android:textSize="25sp"

            app:autoSizeTextType="none"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView18"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />

        <TextView
            android:id="@+id/textView21"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="153dp"
            android:background="#FFFF3B"
            android:gravity="center"

            android:textAlignment="center"
            android:textSize="25sp"

            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />

        <TextView
            android:id="@+id/textView22"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="153dp"
            android:background="#FFFF3B"
            android:gravity="center"

            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView21"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />

        <TextView
            android:id="@+id/textView23"
            android:layout_width="35dp"
            android:layout_height="35dp"
            android:text="3"
            android:layout_marginStart="8dp"
            android:layout_marginTop="153dp"
            android:background="#FFFF3B"
            android:gravity="center"

            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView22"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView24"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="11dp"
            android:layout_marginTop="153dp"
            android:background="#FFFF3B"
            android:gravity="center"

            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView23"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView25"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="153dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView24"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView26"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="153dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView25"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView27"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="11dp"
            android:layout_marginTop="153dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView26"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView28"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="153dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView27"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView29"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="153dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView28"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />

        <TextView
            android:id="@+id/textView31"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="197dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />

        <TextView
            android:id="@+id/textView32"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="197dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView31"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView33"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="197dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView32"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />

        <TextView
            android:id="@+id/textView34"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="11dp"
            android:layout_marginTop="197dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView33"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView35"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="197dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView34"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView36"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="197dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView35"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView37"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="11dp"
            android:layout_marginTop="197dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView36"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView38"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="197dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView37"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView39"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="197dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView38"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />

        <TextView
            android:id="@+id/textView41"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="244dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />

        <TextView
            android:id="@+id/textView42"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="244dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView41"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView43"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="244dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView42"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView44"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="11dp"
            android:layout_marginTop="244dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView43"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView45"
            android:layout_width="35dp"
            android:layout_height="35dp"
            android:text="5"
            android:layout_marginStart="8dp"
            android:layout_marginTop="244dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView44"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView46"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="244dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView45"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView47"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="11dp"
            android:layout_marginTop="244dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView46"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView48"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="244dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView47"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView49"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="244dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView48"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView51"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="287dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />

        <TextView
            android:id="@+id/textView52"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="287dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView51"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView53"
            android:layout_width="35dp"
            android:layout_height="35dp"
            android:text="9"
            android:layout_marginStart="8dp"
            android:layout_marginTop="287dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView52"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView54"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="11dp"
            android:layout_marginTop="287dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView53"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView55"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="287dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView54"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView56"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="287dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView55"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView57"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="11dp"
            android:layout_marginTop="287dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView56"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView58"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="287dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView57"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView59"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="287dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView58"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView61"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="330dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />

        <TextView
            android:id="@+id/textView62"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="330dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView61"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView63"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="330dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView62"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView64"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="11dp"
            android:layout_marginTop="330dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView63"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView65"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="330dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView64"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView66"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="330dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView65"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView67"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="11dp"
            android:layout_marginTop="330dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView66"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView68"
            android:layout_width="35dp"
            android:layout_height="35dp"
            android:text="6"
            android:layout_marginStart="8dp"
            android:layout_marginTop="330dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView67"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView69"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="330dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView68"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView71"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="377dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />

        <TextView
            android:id="@+id/textView72"
            android:layout_width="35dp"
            android:layout_height="35dp"
            android:text="9"
            android:layout_marginStart="8dp"
            android:layout_marginTop="377dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView71"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView73"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="377dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView72"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView74"
            android:layout_width="35dp"
            android:layout_height="35dp"
            android:text="8"
            android:layout_marginStart="11dp"
            android:layout_marginTop="377dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView73"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView75"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="377dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView74"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView76"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="377dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView75"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView77"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="11dp"
            android:layout_marginTop="377dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView76"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView78"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="377dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView77"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView79"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="377dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView78"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView81"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="420dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />

        <TextView
            android:id="@+id/textView82"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="420dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView81"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView83"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="420dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView82"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView84"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="11dp"
            android:layout_marginTop="420dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView83"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView85"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="420dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView84"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView86"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="420dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"

            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView85"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView87"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="11dp"
            android:layout_marginTop="420dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView86"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView88"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="420dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView87"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView89"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="420dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView88"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView91"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="463dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />

        <TextView
            android:id="@+id/textView92"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="463dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView91"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView93"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="463dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView92"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView94"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="11dp"
            android:layout_marginTop="463dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView93"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView95"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="463dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView94"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView96"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="463dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView95"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView97"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="11dp"
            android:layout_marginTop="463dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView96"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView98"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="463dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView97"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView99"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="463dp"
            android:background="#FFFF3B"
            android:gravity="center"
            android:textAlignment="center"
            android:textSize="25sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView98"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />

        <TextView
            android:id="@+id/textView1"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="520dp"
            android:background="#03A9F4"
            android:gravity="center"
            android:text="1"
            android:textAlignment="center"
            android:textSize="25sp"
            android:textStyle="bold"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />

        <TextView
            android:id="@+id/textView2"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="520dp"
            android:background="#03A9F4"
            android:gravity="center"
            android:text="2"
            android:textAlignment="center"
            android:textSize="25sp"
            android:textStyle="bold"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView1"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView3"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="520dp"
            android:background="#03A9F4"
            android:gravity="center"
            android:text="3"
            android:textAlignment="center"
            android:textSize="25sp"
            android:textStyle="bold"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView2"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView4"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="11dp"
            android:layout_marginTop="520dp"
            android:background="#03A9F4"
            android:gravity="center"
            android:text="4"
            android:textAlignment="center"
            android:textSize="25sp"
            android:textStyle="bold"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView3"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView5"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="520dp"
            android:background="#03A9F4"
            android:gravity="center"
            android:text="5"
            android:textAlignment="center"
            android:textSize="25sp"
            android:textStyle="bold"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView4"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView6"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="520dp"
            android:background="#03A9F4"
            android:gravity="center"
            android:text="6"
            android:textAlignment="center"
            android:textSize="25sp"
            android:textStyle="bold"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView5"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView7"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="11dp"
            android:layout_marginTop="520dp"
            android:background="#03A9F4"
            android:gravity="center"
            android:text="7"
            android:textAlignment="center"
            android:textSize="25sp"
            android:textStyle="bold"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView6"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView8"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="520dp"
            android:background="#03A9F4"
            android:gravity="center"
            android:text="8"
            android:textAlignment="center"
            android:textSize="25sp"
            android:textStyle="bold"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView7"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />
        <TextView
            android:id="@+id/textView9"
            android:layout_width="35dp"
            android:layout_height="35dp"

            android:layout_marginStart="8dp"
            android:layout_marginTop="520dp"
            android:background="#03A9F4"
            android:gravity="center"
            android:text="9"
            android:textAlignment="center"
            android:textSize="25sp"
            android:textStyle="bold"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/textView8"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.0" />

        <TextView
            android:id="@+id/textView100"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"

            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <Button
            android:id="@+id/button1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="10dp"
            android:layout_marginTop="20dp"
            android:text="编辑完成"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/textView1" />

        <Button
            android:id="@+id/button2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="10dp"
            android:layout_marginTop="5dp"
            android:text="重新编辑"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/button1" />


        <Button
            android:id="@+id/button6"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:layout_marginTop="20dp"
            android:text="读取"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/button3"
            app:layout_constraintTop_toBottomOf="@+id/textView7" />

        <Button
            android:id="@+id/button4"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:layout_marginTop="5dp"
            android:text="重        玩"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/button2"
            app:layout_constraintTop_toBottomOf="@+id/button1" />
        <Button
            android:id="@+id/button5"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:layout_marginTop="72dp"
            android:text="写入"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/button3"
            app:layout_constraintTop_toBottomOf="@+id/textView7" />


        <Button
            android:id="@+id/button3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:layout_marginTop="20dp"
            android:text="清        空"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toEndOf="@+id/button1"
            app:layout_constraintTop_toBottomOf="@+id/textView7" />

        <View
            android:id="@+id/view"
            android:layout_width="2dp"
            android:layout_height="405dp"
            android:layout_marginStart="2dp"
            android:layout_marginTop="102dp"
            android:background="#000000"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <View
            android:id="@+id/view1"
            android:layout_width="2dp"
            android:layout_height="405dp"
            android:layout_marginStart="400dp"
            android:layout_marginTop="102dp"
            android:background="#000000"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <View
            android:id="@+id/view2"
            android:layout_width="2dp"
            android:layout_height="405dp"
            android:layout_marginStart="134dp"
            android:layout_marginTop="102dp"
            android:background="#000000"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <View
            android:id="@+id/view14"
            android:layout_width="1dp"
            android:layout_height="405dp"
            android:layout_marginStart="46dp"
            android:layout_marginTop="102dp"
            android:background="#000000"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <View
            android:id="@+id/view15"
            android:layout_width="1dp"
            android:layout_height="405dp"
            android:layout_marginStart="89dp"
            android:layout_marginTop="102dp"
            android:background="#000000"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <View
            android:id="@+id/view16"
            android:layout_width="1dp"
            android:layout_height="405dp"
            android:layout_marginStart="179dp"
            android:layout_marginTop="102dp"
            android:background="#000000"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <View
            android:id="@+id/view17"
            android:layout_width="1dp"
            android:layout_height="405dp"
            android:layout_marginStart="222dp"
            android:layout_marginTop="102dp"
            android:background="#000000"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <View
            android:id="@+id/view18"
            android:layout_width="1dp"
            android:layout_height="405dp"
            android:layout_marginStart="311dp"
            android:layout_marginTop="102dp"
            android:background="#000000"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <View
            android:id="@+id/view19"
            android:layout_width="1dp"
            android:layout_height="405dp"
            android:layout_marginStart="354dp"
            android:layout_marginTop="102dp"
            android:background="#000000"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <View
            android:id="@+id/view3"
            android:layout_width="2dp"
            android:layout_height="405dp"
            android:layout_marginStart="266dp"
            android:layout_marginTop="102dp"
            android:background="#000000"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <View
            android:id="@+id/view8"
            android:layout_width="398dp"
            android:layout_height="1dp"
            android:layout_marginStart="2dp"
            android:layout_marginTop="148dp"
            android:background="#000000"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <View
            android:id="@+id/view9"
            android:layout_width="398dp"
            android:layout_height="1dp"
            android:layout_marginStart="2dp"
            android:layout_marginTop="192dp"
            android:background="#000000"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <View
            android:id="@+id/view10"
            android:layout_width="398dp"
            android:layout_height="1dp"
            android:layout_marginStart="2dp"
            android:layout_marginTop="282dp"
            android:background="#000000"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <View
            android:id="@+id/view11"
            android:layout_width="398dp"
            android:layout_height="1dp"
            android:layout_marginStart="2dp"
            android:layout_marginTop="325dp"
            android:background="#000000"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <View
            android:id="@+id/view12"
            android:layout_width="398dp"
            android:layout_height="1dp"
            android:layout_marginStart="2dp"
            android:layout_marginTop="416dp"
            android:background="#000000"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <View
            android:id="@+id/view13"
            android:layout_width="398dp"
            android:layout_height="1dp"
            android:layout_marginStart="2dp"
            android:layout_marginTop="458dp"
            android:background="#000000"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />


        <View
            android:id="@+id/view4"
            android:layout_width="398dp"
            android:layout_height="2dp"
            android:layout_marginStart="3dp"
            android:layout_marginTop="102dp"
            android:background="#000000"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <View
            android:id="@+id/view5"
            android:layout_width="398dp"
            android:layout_height="2dp"
            android:layout_marginStart="2dp"
            android:layout_marginTop="236dp"
            android:background="#000000"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <View
            android:id="@+id/view6"
            android:layout_width="398dp"
            android:layout_height="2dp"
            android:layout_marginStart="2dp"
            android:layout_marginTop="370dp"
            android:background="#000000"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <View
            android:id="@+id/view7"
            android:layout_width="398dp"
            android:layout_height="2dp"
            android:layout_marginStart="2dp"
            android:layout_marginTop="506dp"
            android:background="#000000"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

    </androidx.constraintlayout.widget.ConstraintLayout>

filehelper.java

package com.shudu.filesaveandread;

import android.content.Context;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * Created by Jay on 2015/9/1 0001.
 */
public class FileHelper {

    private Context mContext;

    public FileHelper() {
    }

    public FileHelper(Context mContext) {
        super();
        this.mContext = mContext;
    }

    /*
     * 这里定义的是一个文件保存的方法,写入到文件中,所以是输出流
     * */
    public void save(String filename, String filecontent) throws Exception {
        //这里我们使用私有模式,创建出来的文件只能被本应用访问,还会覆盖原文件哦
        FileOutputStream output = mContext.openFileOutput(filename, Context.MODE_PRIVATE);
        output.write(filecontent.getBytes());  //将String字符串以字节流的形式写入到输出流中
        output.close();         //关闭输出流
    }


    /*
     * 这里定义的是文件读取的方法
     * */
    public String read(String filename) throws IOException {
        //打开文件输入流
        FileInputStream input = mContext.openFileInput(filename);
        byte[] temp = new byte[1024];
        StringBuilder sb = new StringBuilder("");
        int len = 0;
        //读取文件内容:
        while ((len = input.read(temp)) > 0) {
            sb.append(new String(temp, 0, len));
        }
        //关闭输入流
        input.close();
        return sb.toString();
    }

}

mainactivity.java

package com.shudu.filesaveandread;

import android.content.Context;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    public TextView mytextview;
    private static TextView[]textViews;//81个textview
    private static TextView[][]textViewshang;//9行二维数组
    private static TextView[][]textViewslie;//9列二维数组
    private static TextView[][]textViewsgong;//9组二维数组
    private static TextView[][] textViewhangliegong;
    private static TextView[] anniushuzi;//1,2,3..。10数字的数组
    private static TextView[] textViewshang1,textViewshang2,textViewshang3,textViewshang4,textViewshang5,textViewshang6,textViewshang7, textViewshang8, textViewshang9;
    private static TextView[]textViewslie1,textViewslie2,textViewslie3,textViewslie4,textViewslie5,textViewslie6,textViewslie7, textViewslie8, textViewslie9;
    private static TextView[]textviewgonh1,textviewgonh2,textviewgonh3,textviewgonh4,textviewgonh5,textviewgonh6, textviewgonh7, textviewgonh8,textviewgonh9;
    private TextView textview1,textview2,textview3,textview4,textview5,textview6,textview7,textview8,textview9;
    private TextView textview11,textview12,textview13,textview14,textview15,textview16,textview17,textview18,textview19;
    private TextView textview21,textview22,textview23,textview24,textview25,textview26,textview27,textview28,textview29;
    private TextView textview31,textview32,textview33,textview34,textview35,textview36,textview37,textview38,textview39;
    private TextView textview41,textview42,textview43,textview44,textview45,textview46,textview47,textview48,textview49;
    private TextView textview51,textview52,textview53,textview54,textview55,textview56,textview57,textview58,textview59;
    private TextView textview61,textview62,textview63,textview64,textview65,textview66,textview67,textview68,textview69;
    private TextView  textview71, textview72, textview73, textview74, textview75, textview76, textview77, textview78, textview79;
    private TextView  textview81, textview82, textview83, textview84, textview85, textview86, textview87, textview88, textview89;
    private TextView  textview91, textview92, textview93, textview94, textview95, textview96, textview97, textview98, textview99;

    private Button button1,button2,button3,button4,button5,button6;
    private Context mContext;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        mContext = getApplicationContext();
        setContentView(R.layout.activity_main);
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });
        mytextview = (TextView) findViewById(R.id.textView100);//作为数据交换的中间textview

        textview1 = (TextView) findViewById(R.id.textView1);
        textview2 = (TextView) findViewById(R.id.textView2);
        textview3 = (TextView) findViewById(R.id.textView3);
        textview4 = (TextView) findViewById(R.id.textView4);
        textview5 = (TextView) findViewById(R.id.textView5);
        textview6 = (TextView) findViewById(R.id.textView6);
        textview7 = (TextView) findViewById(R.id.textView7);
        textview8 = (TextView) findViewById(R.id.textView8);
        textview9 = (TextView) findViewById(R.id.textView9);

        textview11 = (TextView) findViewById(R.id.textView11);
        textview12 = (TextView) findViewById(R.id.textView12);
        textview13 = (TextView) findViewById(R.id.textView13);
        textview14 = (TextView) findViewById(R.id.textView14);
        textview15 = (TextView) findViewById(R.id.textView15);
        textview16 = (TextView) findViewById(R.id.textView16);
        textview17 = (TextView) findViewById(R.id.textView17);
        textview18 = (TextView) findViewById(R.id.textView18);
        textview19 = (TextView) findViewById(R.id.textView19);

        textview21 = (TextView) findViewById(R.id.textView21);
        textview22 = (TextView) findViewById(R.id.textView22);
        textview23 = (TextView) findViewById(R.id.textView23);
        textview24 = (TextView) findViewById(R.id.textView24);
        textview25 = (TextView) findViewById(R.id.textView25);
        textview26 = (TextView) findViewById(R.id.textView26);
        textview27 = (TextView) findViewById(R.id.textView27);
        textview28 = (TextView) findViewById(R.id.textView28);
        textview29 = (TextView) findViewById(R.id.textView29);

        textview31 = (TextView) findViewById(R.id.textView31);
        textview32 = (TextView) findViewById(R.id.textView32);
        textview33 = (TextView) findViewById(R.id.textView33);
        textview34 = (TextView) findViewById(R.id.textView34);
        textview35 = (TextView) findViewById(R.id.textView35);
        textview36 = (TextView) findViewById(R.id.textView36);
        textview37 = (TextView) findViewById(R.id.textView37);
        textview38 = (TextView) findViewById(R.id.textView38);
        textview39 = (TextView) findViewById(R.id.textView39);

        textview41 = (TextView) findViewById(R.id.textView41);
        textview42 = (TextView) findViewById(R.id.textView42);
        textview43 = (TextView) findViewById(R.id.textView43);
        textview44 = (TextView) findViewById(R.id.textView44);
        textview45 = (TextView) findViewById(R.id.textView45);
        textview46 = (TextView) findViewById(R.id.textView46);
        textview47 = (TextView) findViewById(R.id.textView47);
        textview48 = (TextView) findViewById(R.id.textView48);
        textview49 = (TextView) findViewById(R.id.textView49);

        textview51 = (TextView) findViewById(R.id.textView51);
        textview52 = (TextView) findViewById(R.id.textView52);
        textview53 = (TextView) findViewById(R.id.textView53);
        textview54 = (TextView) findViewById(R.id.textView54);
        textview55 = (TextView) findViewById(R.id.textView55);
        textview56 = (TextView) findViewById(R.id.textView56);
        textview57 = (TextView) findViewById(R.id.textView57);
        textview58 = (TextView) findViewById(R.id.textView58);
        textview59 = (TextView) findViewById(R.id.textView59);

        textview61 = (TextView) findViewById(R.id.textView61);
        textview62 = (TextView) findViewById(R.id.textView62);
        textview63 = (TextView) findViewById(R.id.textView63);
        textview64 = (TextView) findViewById(R.id.textView64);
        textview65 = (TextView) findViewById(R.id.textView65);
        textview66 = (TextView) findViewById(R.id.textView66);
        textview67 = (TextView) findViewById(R.id.textView67);
        textview68 = (TextView) findViewById(R.id.textView68);
        textview69 = (TextView) findViewById(R.id.textView69);

        textview71 = (TextView) findViewById(R.id.textView71);
        textview72 = (TextView) findViewById(R.id.textView72);
        textview73 = (TextView) findViewById(R.id.textView73);
        textview74 = (TextView) findViewById(R.id.textView74);
        textview75 = (TextView) findViewById(R.id.textView75);
        textview76 = (TextView) findViewById(R.id.textView76);
        textview77 = (TextView) findViewById(R.id.textView77);
        textview78 = (TextView) findViewById(R.id.textView78);
        textview79 = (TextView) findViewById(R.id.textView79);

        textview81 = (TextView) findViewById(R.id.textView81);
        textview82 = (TextView) findViewById(R.id.textView82);
        textview83 = (TextView) findViewById(R.id.textView83);
        textview84 = (TextView) findViewById(R.id.textView84);
        textview85 = (TextView) findViewById(R.id.textView85);
        textview86 = (TextView) findViewById(R.id.textView86);
        textview87 = (TextView) findViewById(R.id.textView87);
        textview88 = (TextView) findViewById(R.id.textView88);
        textview89 = (TextView) findViewById(R.id.textView89);

        textview91 = (TextView) findViewById(R.id.textView91);
        textview92 = (TextView) findViewById(R.id.textView92);
        textview93 = (TextView) findViewById(R.id.textView93);
        textview94 = (TextView) findViewById(R.id.textView94);
        textview95 = (TextView) findViewById(R.id.textView95);
        textview96 = (TextView) findViewById(R.id.textView96);
        textview97 = (TextView) findViewById(R.id.textView97);
        textview98 = (TextView) findViewById(R.id.textView98);
        textview99 = (TextView) findViewById(R.id.textView99);
        //81个位置
        textViews = new TextView[]{
                textview11,textview12,textview13,textview14,textview15,textview16,textview17,textview18,textview19,
                textview21,textview22,textview23,textview24,textview25,textview26,textview27,textview28,textview29,
                textview31,textview32,textview33,textview34,textview35,textview36,textview37,textview38,textview39,
                textview41,textview42,textview43,textview44,textview45,textview46,textview47,textview48,textview49,
                textview51,textview52,textview53,textview54,textview55,textview56,textview57,textview58,textview59,
                textview61,textview62,textview63,textview64,textview65,textview66,textview67,textview68,textview69,
                textview71,textview72,textview73,textview74,textview75,textview76,textview77,textview78,textview79,
                textview81,textview82,textview83,textview84,textview85,textview86,textview87,textview88,textview89,
                textview91,textview92,textview93,textview94,textview95,textview96,textview97,textview98,textview99
        };
        //行
        textViewshang1 = new TextView[]{textview11,textview12,textview13,textview14,textview15,textview16,textview17,textview18,textview19};
        textViewshang2 = new TextView[]{textview21,textview22,textview23,textview24,textview25,textview26,textview27,textview28,textview29};
        textViewshang3 = new TextView[]{textview31,textview32,textview33,textview34,textview35,textview36,textview37,textview38,textview39};
        textViewshang4 = new TextView[]{textview41,textview42,textview43,textview44,textview45,textview46,textview47,textview48,textview49};
        textViewshang5 = new TextView[]{textview51,textview52,textview53,textview54,textview55,textview56,textview57,textview58,textview59};
        textViewshang6 = new TextView[]{textview61,textview62,textview63,textview64,textview65,textview66,textview67,textview68,textview69};
        textViewshang7 = new TextView[]{textview71,textview72,textview73,textview74,textview75,textview76,textview77,textview78,textview79};
        textViewshang8 = new TextView[]{textview81,textview82,textview83,textview84,textview85,textview86,textview87,textview88,textview89};
        textViewshang9 = new TextView[]{textview91,textview92,textview93,textview94,textview95,textview96,textview97,textview98,textview99};
        //列
        textViewslie1 = new TextView[]{textview11,textview21,textview31,textview41,textview51,textview61,textview71,textview81,textview91};
        textViewslie2 = new TextView[]{textview12,textview22,textview32,textview42,textview52,textview62,textview72,textview82,textview92};
        textViewslie3 = new TextView[]{textview13,textview23,textview33,textview43,textview53,textview63,textview73,textview83,textview93};
        textViewslie4 = new TextView[]{textview14,textview24,textview34,textview44,textview54,textview64,textview74,textview84,textview94};
        textViewslie5 = new TextView[]{textview15,textview25,textview35,textview45,textview55,textview65,textview75,textview85,textview95};
        textViewslie6 = new TextView[]{textview16,textview26,textview36,textview46,textview56,textview66,textview76,textview86,textview96};
        textViewslie7 = new TextView[]{textview17,textview27,textview37,textview47,textview57,textview67,textview77,textview87,textview97};
        textViewslie8 = new TextView[]{textview18,textview28,textview38,textview48,textview58,textview68,textview78,textview88,textview98};
        textViewslie9 = new TextView[]{textview19,textview29,textview39,textview49,textview59,textview69,textview79,textview89,textview99};
        //宫
        textviewgonh1 = new TextView[]{textview11,textview12,textview13,textview21,textview22,textview23,textview31,textview32,textview33};
        textviewgonh2 = new TextView[]{textview14,textview15,textview16,textview24,textview25,textview26,textview34,textview35,textview36};
        textviewgonh3 = new TextView[]{textview17,textview18,textview19,textview27,textview28,textview29,textview37,textview38,textview39};
        textviewgonh4 = new TextView[]{textview41,textview42,textview43,textview51,textview52,textview53,textview61,textview62,textview63};
        textviewgonh5 = new TextView[]{textview44,textview45,textview46,textview54,textview55,textview56,textview64,textview65,textview66};
        textviewgonh6 = new TextView[]{textview47,textview47,textview49,textview57,textview58,textview59,textview67,textview68,textview69};
        textviewgonh7 = new TextView[]{textview71,textview72,textview73,textview81,textview82,textview83,textview91,textview92,textview93};
        textviewgonh8 = new TextView[]{textview74,textview75,textview76,textview84,textview85,textview86,textview94,textview95,textview96};
        textviewgonh9 = new TextView[]{textview77,textview78,textview79,textview87,textview88,textview89,textview97,textview98,textview99};

        textViewshang=new TextView[][]{textViewshang1,textViewshang2,textViewshang3,textViewshang4,textViewshang5,textViewshang6,textViewshang7,textViewshang8,textViewshang9};
        textViewslie=new TextView[][]{textViewslie1,textViewslie2,textViewslie3,textViewslie4,textViewslie5,textViewslie6,textViewslie7,textViewslie8,textViewslie9};
        textViewsgong=new TextView[][]{textviewgonh1,textviewgonh2,textviewgonh3,textviewgonh4,textviewgonh5,textviewgonh6,textviewgonh7,textviewgonh8,textviewgonh9};
        textViewhangliegong=new TextView[][]{
                textViewshang1,textViewshang2,textViewshang3,textViewshang4,textViewshang5,textViewshang6,textViewshang7,textViewshang8,textViewshang9,
                textViewslie1,textViewslie2,textViewslie3,textViewslie4,textViewslie5,textViewslie6,textViewslie7,textViewslie8,textViewslie9,
                textviewgonh1,textviewgonh2,textviewgonh3,textviewgonh4,textviewgonh5,textviewgonh6,textviewgonh7,textviewgonh8,textviewgonh9
        };
        anniushuzi=new TextView[]{textview1,textview2,textview3,textview4,textview5,textview6,textview7,textview8,textview9};
        button1 = (Button) findViewById(R.id.button1);
        button2 = (Button) findViewById(R.id.button2);
        button3 = (Button) findViewById(R.id.button3);
        button4 = (Button) findViewById(R.id.button4);
        button5 = (Button) findViewById(R.id.button5);
        button6 = (Button) findViewById(R.id.button6);

        button1.setOnClickListener(this);
        button2.setOnClickListener(this);
        button3.setOnClickListener(this);
        button4.setOnClickListener(this);
        button5.setOnClickListener(this);
        button6.setOnClickListener(this);
    }
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.button1://编辑完成
                for (TextView textView : textViews) {
                    if(textView.getText().toString()==""){
                        textView.setTextColor(Color.RED);
//                        settextviewcolor();
                    }
                }

                break;
            case R.id.button2://重新编辑
                for (TextView textView : textViews) {
                    //如果text为空或字体为红色清除text并将text设置为黑色
                    if(textView.getText().toString()=="" ||textView.getCurrentTextColor()==0xffff0000) {
                        textView.setText("");
                        textView.setTextColor(Color.BLACK);
//                        settextviewcolor();

                    }
                }
                break;
            case R.id.button3://清空
                for (TextView textView : textViews) {
                    textView.setText("");//清空text
                    textView.setTextColor(Color.BLACK);//设置text为黑色
                    textView.setBackgroundColor(Color.YELLOW);
//                    settextviewcolor();
                }
                break;
            case R.id.button4://重玩
                for (TextView textView : textViews) {
                    if(textView.getCurrentTextColor()==0xffff0000) {//只设置text为红色的text为空
                        textView.setText("");
//                        settextviewcolor();
                    }
                }

                break;
            case R.id.button5://随机题目
                save();
                break;
            case R.id.button6://清除

                readFileAndSplit();

//                mytextview.setText("");
//                for (TextView textView : textViews) {
//                    textView.setBackgroundColor(Color.YELLOW);
//                }
                break;
        }

    }
    @Override
    public void onPointerCaptureChanged(boolean hasCapture) {
        super.onPointerCaptureChanged(hasCapture);
    }
    public void save(){
        StringBuilder stringBuilder=new StringBuilder();
        FileHelper fHelper = new FileHelper(mContext);
        for (TextView textView:textViews ){
            String strings =textView.getText().toString();
            stringBuilder.append(strings).append(",");
        }
        try {
            String filename = "10000.txt";
            fHelper.save(filename, stringBuilder.toString());
            //System.out.println("文件名为:"+filename);
            Toast.makeText(getApplicationContext(), "数据写入成功", Toast.LENGTH_SHORT).show();
        } catch (Exception e) {
            e.printStackTrace();
            Toast.makeText(getApplicationContext(), "数据写入失败", Toast.LENGTH_SHORT).show();
        }

    }
    private void readFileAndSplit(){
        File file =new File(getFilesDir(),"10000.txt");//这个必须单独写,不能直接写到try里面,不知道为啥。
        try(BufferedReader reader=new BufferedReader(new FileReader(file))){
            String line=reader.readLine();//读取行
            String[] parts=line.split(",");//split按照“,”分割,并写进part1数组
            int b=0;//计数,为了同步设置textviews里面81个textview.
            for(String a :parts){
                textViews[b].setText(a);//同步修改相应位置textview的text.
                b+=1;//计数加1
            }
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2258062.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

分库分表基本概念讲解

一、基本概念 产生背景 在数据爆炸的年代&#xff0c;单表数据达到千万级别&#xff0c;甚至过亿的量&#xff0c;都是很常见的情景。这时候再对数据库进行操作就是非常吃力的事情了&#xff0c;select个半天都出不来数据&#xff0c;这时候业务已经难以维系。不得已&#xf…

华为自反ACL实验

一、实验背景 做这个实验的原因是最近公司里上了三台小程序服务器&#xff0c;由于三台服务器的端口都映射出去了&#xff0c;领导要求A网段的三台服务器不能访问内网B&#xff0c;C网段&#xff0c;同时B、C网段内网用户可以访问A段的94、95、96服务器&#xff1b; 也就是PC4\…

美图撕掉蔡文胜标签

卖掉比特币的美图不投机了。 作者|周立青 编辑|杨舟 12月5日&#xff0c;比特币突破10万美元大关&#xff0c;曾花费1亿美元购入虚拟货币的美图宣布已出售所有加密货币。 美图在港交所发布公告称&#xff0c;自2024年11月起&#xff0c;公司已开始出售其持有的加密货币&…

git拉取代码报错问题:Pulling is not possible because you have unmerged files. hint

我们在工作中&#xff0c;需要切换到另外一个分支&#xff0c;拉取代码的时候会报这样的问题&#xff1a; Pulling is not possible because you have unmerged files. hint: Fix them up in the work tree, and then use git add/rm <file> hint: as appropriate to ma…

青训营-豆包MarsCode技术训练营试题解析三十七

引言 随着AI领域的发展&#xff0c;底层算法确实起到了决定性的作用。为了跟上这个快速发展的领域&#xff0c;我们需要不断学习和提升自己的技能。刷题是一种很好的方式&#xff0c;可以帮助我们巩固基础知识&#xff0c;提高解决问题的能力。 介绍 ‌豆包青训营‌是由字节…

openlayers地图缓存添加

//通过安装包localforage&#xff08;npm install localforage&#xff09;或https://cdnjs.cloudflare.com/ajax/libs/localforage/1.10.0/localforage.min.js tileCacheStore.js import localforage from localforage var tileCacheStorenull;// 从缓存中获取该瓦片 functio…

《IP 电话:选型指南与应用优势》

《IP 电话&#xff1a;选型指南与应用优势》 一、IP 电话概述二、IP 电话的选型1. 功能与应用2. 性能及可靠性3. 兼容及可升级性4. 外观设计及管理需求5. 性价比 三、IP 电话的应用场景1. 企业办公2. 工厂和仓库3. 酒店和旅游业4. 医疗机构5. 零售业6. 教育机构7. 个人用户 四、…

解决Logitech G hub 无法进入一直转圈的方案(2024.12)

如果你不是最新版本无法加载尝试以下方案&#xff1a;删除AppData 文件夹下的logihub文件夹 具体路径&#xff1a;用户名根据实际你的请情况修改 C:\Users\Administrator\AppData\Local 如果你有通过lua编译脚本&#xff0c;记得备份&#xff01;&#xff01; ↓如果你是最新…

[网络爬虫] Jsoup : HTML 解析工具

1 概述 简介 Jsoup是一款基于Java的HTML解析器&#xff0c;它提供了一种简单、灵活且易于使用的API&#xff0c;用于从URL、文件或字符串中解析HTML文档。它可以帮助开发人员从HTML文档中提取数据、操作DOM元素、处理表单提交等。 主要特点 Jsoup的主要特点包括&#xff1a; 简…

top命令和系统负载

1 top中的字段说明 top是一个实时系统监视工具&#xff0c;可以动态展现出 CPU 使用率、内存使用情况、进程状态等信息&#xff0c;注意这些显示的文本不能直接使用 > 追加到文件中。 [rootvv~]# top -bn 1 | head top - 20:08:28 up 138 days, 10:29, 4 users, load av…

golang实现简单的redis服务4(实现过期时间功能)

为什么要做过期时间?redis失效时间是如何做的redis有那些过期策略,优缺点,实现原理?redis使用的什么方案 redis 有那些内存淘汰策略?常用的是什么,为什么?noeviction: 不处理lru: 未使用时间最久的keylfu: 使用次数最少的keyrandom: 随机keyvolatile与allkeys的区别 仓库地…

VMware:如何在CentOS7上开启22端口

打开虚拟机&#xff1a;【编辑】【虚拟机网络设置】 其中填入的虚拟机IP地址是虚拟机中centos的IP地址&#xff0c;虚拟机端口为需要映射的centos端口 配置好之后保存&#xff0c;打开宿主机 win cmd telnet 192.168.1.26 22 如果出现上述窗口&#xff0c;则说明已经成功开放…

项目中使用AntV L7地图(五)添加飞线

项目中使用AntV L7地图&#xff0c;添加 飞线 文档地址&#xff1a;https://l7.antv.antgroup.com/zh/examples/line/animate/#trip_animate 一、初始化地图 使用的地图文件为四川地图JSON&#xff0c;下载地址:https://datav.aliyun.com/portal/school/atlas/area_selector#&…

基于FPGA的智能电子密码指纹锁(开源全免)

基于FPGA的智能电子密码指纹锁 一、功能描述硬件资源需求 二、整体框架知识准备AS608指纹模块4*4数字键盘模块 三、Verilog代码实现以及仿真验证1.AS608_data模块2.check_hand模块3.four_four_key模块4.check_mima模块5.change_mima模块6.seg_ctrl模块7.uart_top模块8.key_debo…

【Vue2+Element-ui】el-dialog宽度适配

1、不适配问题 分辨率100%-页面 分辨率150%-页面 在项目中&#xff0c;我开发分辨率一直是100%&#xff0c;但是客户使用的分辨率不相同&#xff0c;所以宽度要适配 2、解决-封装mixins.js 1)、封装的mixins 我将宽度设置成动态的&#xff0c;因为我的项目中需求不同。 expor…

css矩形样式,两边圆形

废话不多说&#xff0c;代码如下&#xff0c;直接拷贝即可使用&#xff1a; index.vue文件 <template><view class"wrap"><view class"tabs"><view class"tab active"><view class"name">标签</view…

【OpenCV】图像阈值

简单阈值法 此方法是直截了当的。如果像素值大于阈值&#xff0c;则会被赋为一个值&#xff08;可能为白色&#xff09;&#xff0c;否则会赋为另一个值&#xff08;可能为黑色&#xff09;。使用的函数是 cv.threshold。第一个参数是源图像&#xff0c;它应该是灰度图像。第二…

使用微信小程序调用飞桨PaddleX平台自行训练的模型——微信小程序用训练的牡丹花模型Demo测试

&#x1f3bc;个人主页&#xff1a;【Y小夜】 &#x1f60e;作者简介&#xff1a;一位双非学校的大二学生&#xff0c;编程爱好者&#xff0c; 专注于基础和实战分享&#xff0c;欢迎私信咨询&#xff01; &#x1f386;入门专栏&#xff1a;&#x1f387;【MySQL&#xff0…

Wordpress设置固定链接形式后出现404错误

比如固定连接设置为 /archives/%post_id%.html 这种形式&#xff0c;看起来比较舒服。对搜索引擎也友好。 出现404需要设置伪静态

JavaWeb学习--cookie和session,实现登录的记住我和验证码功能

目录 &#xff08;一&#xff09;Cookie概述 1.什么叫Cookie 2.Cookie规范 3.Cookie的覆盖 4.cookie的最大存活时间 ​​​​​​&#xff08;Cookie的生命&#xff09; &#xff08;二&#xff09; Cookie的API 1.创建Cookie&#xff1a;new 构造方法 2.保存到客户端浏…