第17天~ListView再练一个

ListView再练一个
先新增模组:

https://ithelp.ithome.com.tw/upload/images/20220202/20119035ioR71NBr7X.png

https://ithelp.ithome.com.tw/upload/images/20220202/20119035KZbNlZRavL.png

要V generate......
https://ithelp.ithome.com.tw/upload/images/20220202/20119035XvAD22zSms.png


activity_main.xml

https://ithelp.ithome.com.tw/upload/images/20220202/20119035BeWcwxmFvh.png

listView按钮一拉入要四边缩小~
再调整~四边不要绑

https://ithelp.ithome.com.tw/upload/images/20220202/20119035gyhGM0dBme.png

<?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:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <ListView
        android:id="@+id/listView"
        android:layout_width="376dp"
        android:layout_height="521dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="16dp"
        android:layout_marginEnd="8dp"
        app:layout_constraintBottom_toTopOf="@+id/guideline"
        app:layout_constraintEnd_toStartOf="@+id/emptyView"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <Button
        android:id="@+id/ok"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:onClick="onClick"
        android:text="Button"
        app:layout_constraintHorizontal_bias="0.498"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="@+id/guideline" />

    <TextView
        android:id="@+id/emptyView"
        android:layout_width="368dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginTop="24dp"
        android:layout_marginEnd="8dp"
        android:layout_marginBottom="88dp"
        android:text="no_record"
        android:textAppearance="@style/TextAppearance.AppCompat.Large"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.703"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/ok" />

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/guideline"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        app:layout_constraintGuide_percent="0.75" />

</androidx.constraintlayout.widget.ConstraintLayout>

模拟器看目前是空的~

https://ithelp.ithome.com.tw/upload/images/20220202/20119035chnkaUVGuj.png


mylayout.xml
https://ithelp.ithome.com.tw/upload/images/20220202/20119035gE47NPUwNB.png

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ImageView android:id="@+id/imgLogo"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:layout_centerVertical="true"
        android:layout_margin="10dp"
        android:src="@drawable/f201" />

    <TextView android:id="@+id/txtName"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="5dp"
        android:layout_marginTop="2dp"
        android:layout_toRightOf="@id/imgLogo"
        android:text="第一行文字"
        android:textColor="#0000FF"
        android:textSize="24dp" />

    <TextView android:id="@+id/txtengName"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="0dp"
        android:layout_below="@id/txtName"
        android:layout_marginLeft="5dp"
        android:layout_toRightOf="@id/imgLogo"
        android:text="第二行文字"
        android:textColor="#000000"
        android:textSize="16dp" />

</LinearLayout>

模拟器目前看~

https://ithelp.ithome.com.tw/upload/images/20220202/20119035OUgUMJejjG.png


把drawable的图贴入~
https://ithelp.ithome.com.tw/upload/images/20220202/20119035IiJWE4HVss.png

https://ithelp.ithome.com.tw/upload/images/20220202/20119035WIhYzXF6xX.png


strings.xml档

https://ithelp.ithome.com.tw/upload/images/20220202/20119035br9YrA6j24.png

<resources>
    <string name="app_name">MyListView01</string>

    <string-array name="fastfood">
        <item>COCA Light</item>
        <item>COCA Zero</item>
        <item>COCA</item>
        <item>French Fries</item>
        <item>Hamburger</item>
        <item>KFC</item>
        <item>Big Mac</item>
    </string-array>

    <string-array name="price">
        <item>50</item>
        <item>50</item>
        <item>55</item>
        <item>125</item>
        <item>250</item>
        <item>170</item>
        <item>270</item>
    </string-array>

    <string name="no_record">没有资料显示</string>
</resources>


colors.xml 档

https://ithelp.ithome.com.tw/upload/images/20220202/20119035vH8L5tQ6KN.png

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="purple_200">#FFBB86FC</color>
    <color name="purple_500">#FF6200EE</color>
    <color name="purple_700">#FF3700B3</color>
    <color name="teal_200">#FF03DAC5</color>
    <color name="teal_700">#FF018786</color>
    <color name="black">#FF000000</color>
    <color name="white">#FFFFFFFF</color>
    <color name="lvcolor">#77E5FF</color>
</resources>

手机的光是用 RGB 色光
https://ithelp.ithome.com.tw/articles/10208154


再来处理onClick

https://ithelp.ithome.com.tw/upload/images/20220202/20119035WqWTpPH6Id.png

https://ithelp.ithome.com.tw/upload/images/20220202/20119035JYCH4WdBTa.png

ListView再练一个4大步骤-

1.排列东西
2.资料转换
3.放到元件
4.加侦听器


R档是清单.随便找7张图来用

int[] imgIds = {R.drawable.f101,R.drawable.f102,R.drawable.f103,
            R.drawable.f104,R.drawable.f105,R.drawable.f201,R.drawable.f202};

https://ithelp.ithome.com.tw/upload/images/20220202/20119035NrPXcD4Gb6.png


package com.huang.mylistview2;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

    //宣告 名称 价钱 页面资讯 元件 放图片资源 选到什麽东西 字串

    String[] fastfood;
    String[] price;
    Context context;
    ListView listView;
    int[] imgIds = {R.drawable.f101,R.drawable.f102,R.drawable.f103,
            R.drawable.f104,R.drawable.f105,R.drawable.f201,R.drawable.f202};

    TextView show;
    String all="";

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

    public void onClick(View view) {
    }
}

准备初始化元件-

https://ithelp.ithome.com.tw/upload/images/20220202/20119035IxSYwcBGKl.png

package com.huang.mylistview2;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

    //宣告 名称 价钱 页面资讯 元件 放图片资源 选到什麽东西 字串

    String[] fastfood;
    String[] price;
    Context context;
    ListView listView;
    int[] imgIds = {R.drawable.f101,R.drawable.f102,R.drawable.f103,
            R.drawable.f104,R.drawable.f105,R.drawable.f201,R.drawable.f202};

    TextView show;
    String all="";

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

        //初始化元件
        context = this;
        fastfood =getResources().getStringArray(R.array.fastfood);
        price = getResources().getStringArray(R.array.price);
        listView = findViewById(R.id.listView);
        show = findViewById(R.id.emptyView);

    }

    public void onClick(View view) {
    }
}

自订Adapter
https://atceiling.blogspot.com/2021/06/android23-adapter.html

https://ithelp.ithome.com.tw/upload/images/20220202/20119035JXAJ2M71y7.png

https://ithelp.ithome.com.tw/upload/images/20220202/20119035yRHoUDKk7j.png

加入public的权限

https://ithelp.ithome.com.tw/upload/images/20220202/2011903562vVw7qn3u.png


建构子-用右键Generate-->Constructor
https://ithelp.ithome.com.tw/upload/images/20220202/20119035ETsITCQGsn.png

https://ithelp.ithome.com.tw/upload/images/20220202/20119035Br75Nn7bRa.png

只有一个就选这个
https://ithelp.ithome.com.tw/upload/images/20220202/20119035r8a8GTRDnq.png

LayoutInflater inflater要改成页面资讯

https://ithelp.ithome.com.tw/upload/images/20220202/20119035yPsJ25qfka.png


进行初始化-现在反红正常

https://ithelp.ithome.com.tw/upload/images/20220202/20119035Ywg1534RuJ.png

package com.huang.mylistview2;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

    //宣告 名称 价钱 页面资讯 元件 放图片资源 选到什麽东西 字串

    String[] fastfood;
    String[] price;
    Context context;
    ListView listView;
    int[] imgIds = {R.drawable.f101,R.drawable.f102,R.drawable.f103,
            R.drawable.f104,R.drawable.f105,R.drawable.f201,R.drawable.f202};

    TextView show;
    String all="";

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

        //初始化元件
        context = this;
        fastfood =getResources().getStringArray(R.array.fastfood);
        price = getResources().getStringArray(R.array.price);
        listView = findViewById(R.id.listView);
        show = findViewById(R.id.emptyView);

        //自订Adapter

    }

    //自订 class 继承 BaseAdapter,载入layout并分析元件
    public class MyAdapter extends BaseAdapter{
        //版面载入器-->载入layout,并负责将元件初始化
        LayoutInflater inflater;
        //建构子
        public MyAdapter(Context c) {
            //进行初始化
            inflater = LayoutInflater.from(c);
        }
    }

    public void onClick(View view) {
    }
}

建构子-用右键Generate-->implement

https://ithelp.ithome.com.tw/upload/images/20220202/20119035P4ZPPjL2Gz.png

https://ithelp.ithome.com.tw/upload/images/20220202/20119035sGxhC1Guip.png

https://ithelp.ithome.com.tw/upload/images/20220202/20119035Qms9l0nOWZ.png

加入注解
https://ithelp.ithome.com.tw/upload/images/20220202/20119035n6lghADCbg.png

package com.huang.mylistview2;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

    //宣告 名称 价钱 页面资讯 元件 放图片资源 选到什麽东西 字串

    String[] fastfood;
    String[] price;
    Context context;
    ListView listView;
    int[] imgIds = {R.drawable.f101,R.drawable.f102,R.drawable.f103,
            R.drawable.f104,R.drawable.f105,R.drawable.f201,R.drawable.f202};

    TextView show;
    String all="";

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

        //初始化元件
        context = this;
        fastfood =getResources().getStringArray(R.array.fastfood);
        price = getResources().getStringArray(R.array.price);
        listView = findViewById(R.id.listView);
        show = findViewById(R.id.emptyView);

        //自订Adapter

    }

    //自订 class 继承 BaseAdapter,载入layout并分析元件
    public class MyAdapter extends BaseAdapter{
        //版面载入器-->载入layout,并负责将元件初始化
        LayoutInflater inflater;
        //建构子
        public MyAdapter(Context c) {
            //进行初始化
            inflater = LayoutInflater.from(c);
        }

        //取得数量
        @Override
        public int getCount() {
            return 0;
        }
        //取得项目内容
        @Override
        public Object getItem(int i) {
            return null;
        }
        //取得项目顺序
        @Override
        public long getItemId(int i) {
            return 0;
        }
        //载入版面,解析後将资料放入元件中
        @Override
        public View getView(int i, View view, ViewGroup viewGroup) {
            return null;
        }
    }

    public void onClick(View view) {
    }
}

其中

@Override
        public View getView(int i, View view, ViewGroup viewGroup) {
            return null;
        }

改成

 @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            return null;
        }

其中
int i改成 int position

更改後的程序码:

package com.huang.mylistview2;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

    //宣告 名称 价钱 页面资讯 元件 放图片资源 选到什麽东西 字串

    String[] fastfood;
    String[] price;
    Context context;
    ListView listView;
    int[] imgIds = {R.drawable.f101,R.drawable.f102,R.drawable.f103,
            R.drawable.f104,R.drawable.f105,R.drawable.f201,R.drawable.f202};

    TextView show;
    String all="";

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

        //初始化元件
        context = this;
        fastfood =getResources().getStringArray(R.array.fastfood);
        price = getResources().getStringArray(R.array.price);
        listView = findViewById(R.id.listView);
        show = findViewById(R.id.emptyView);

        //自订Adapter

    }

    //自订 class 继承 BaseAdapter,载入layout并分析元件
    public class MyAdapter extends BaseAdapter{
        //版面载入器-->载入layout,并负责将元件初始化
        LayoutInflater inflater;
        //建构子
        public MyAdapter(Context c) {
            //进行初始化
            inflater = LayoutInflater.from(c);
        }

        //取得数量
        @Override
        public int getCount() {
            return 0;
        }
        //取得项目内容
        @Override
        public Object getItem(int position) {
            return null;
        }
        //取得项目顺序
        @Override
        public long getItemId(int position) {
            return 0;
        }
        //载入版面,解析後将资料放入元件中
        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            return null;
        }
    }

    public void onClick(View view) {
    }
}

放入资料-
1-取的7个数量..其他依序更改
https://ithelp.ithome.com.tw/upload/images/20220202/201190354aOkxwXCF2.png

//再来初始化

https://ithelp.ithome.com.tw/upload/images/20220202/20119035bVb2cZ6cSZ.png

从 convertView 开始

https://ithelp.ithome.com.tw/upload/images/20220202/2011903504iHVbuGwF.png

package com.huang.mylistview2;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

    //宣告 名称 价钱 页面资讯 元件 放图片资源 选到什麽东西 字串

    String[] fastfood;
    String[] price;
    Context context;
    ListView listView;
    int[] imgIds = {R.drawable.f101,R.drawable.f102,R.drawable.f103,
            R.drawable.f104,R.drawable.f105,R.drawable.f201,R.drawable.f202};

    TextView show;
    String all="";

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

        //初始化元件
        context = this;
        fastfood =getResources().getStringArray(R.array.fastfood);
        price = getResources().getStringArray(R.array.price);
        listView = findViewById(R.id.listView);
        show = findViewById(R.id.emptyView);

        //自订Adapter

    }

    //自订 class 继承 BaseAdapter,载入layout并分析元件
    public class MyAdapter extends BaseAdapter{
        //版面载入器-->载入layout,并负责将元件初始化
        LayoutInflater inflater;
        //建构子
        public MyAdapter(Context c) {
            //进行初始化
            inflater = LayoutInflater.from(c);
        }

        //取得数量
        @Override
        public int getCount() {
            return fastfood.length;
        }
        //取得项目内容
        @Override
        public Object getItem(int position) {
            return fastfood[position];
        }
        //取得项目顺序
        @Override
        public long getItemId(int position) {
            return position;
        }
        //载入版面,解析後将资料放入元件中
        @Override
        public View getView(int position, View convertView, ViewGroup parent) {

            convertView =inflater.inflate(R.layout.mylayout,null);

            ImageView imgLogo = convertView.findViewById(R.id.imgLogo);
            TextView txtName = convertView.findViewById(R.id.txtName);
            TextView txtPrice = convertView.findViewById(R.id.txtengName);

            imgLogo.setImageResource(imgIds[position]);
            txtName.setText(fastfood[position]);
            txtPrice.setText(price[position]);

            return convertView;
        }
    }

    public void onClick(View view) {
    }
}

再回到//自订Adapter

https://ithelp.ithome.com.tw/upload/images/20220202/20119035dpwy0JmDXa.png

加入侦听器-修正画线地方

https://ithelp.ithome.com.tw/upload/images/20220202/20119035fImXmk9mO3.png

https://ithelp.ithome.com.tw/upload/images/20220202/20119035ttM2kLOJjg.png

https://ithelp.ithome.com.tw/upload/images/20220202/20119035YzcDPYsBXv.png


下面是onClick

https://ithelp.ithome.com.tw/upload/images/20220202/20119035LeQd3o8Dfi.png

目前完整程序码:

package com.huang.mylistview2;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

    //宣告 名称 价钱 页面资讯 元件 放图片资源 选到什麽东西 字串

    String[] fastfood;
    String[] price;
    Context context;
    ListView listView;
    int[] imgIds = {R.drawable.f101,R.drawable.f102,R.drawable.f103,
            R.drawable.f104,R.drawable.f105,R.drawable.f201,R.drawable.f202};

    TextView show;
    String all="";

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

        //初始化元件
        context = this;
        fastfood =getResources().getStringArray(R.array.fastfood);
        price = getResources().getStringArray(R.array.price);
        listView = findViewById(R.id.listView);
        show = findViewById(R.id.emptyView);

        //自订Adapter
        MyAdapter adapter = new MyAdapter(context);
        listView.setAdapter(adapter);

        //加入侦听器
        listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
        listView.setSelector(R.color.lvcolor);
        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                String s_name = fastfood[position];
                String s_price = price[position];

                all += s_name+":"+s_price+"\n";

            }
        });



    }

    //自订 class 继承 BaseAdapter,载入layout并分析元件
    public class MyAdapter extends BaseAdapter{
        //版面载入器-->载入layout,并负责将元件初始化
        LayoutInflater inflater;
        //建构子
        public MyAdapter(Context c) {
            //进行初始化
            inflater = LayoutInflater.from(c);
        }

        //取得数量
        @Override
        public int getCount() {
            return fastfood.length;
        }
        //取得项目内容
        @Override
        public Object getItem(int position) {
            return fastfood[position];
        }
        //取得项目顺序
        @Override
        public long getItemId(int position) {
            return position;
        }
        //载入版面,解析後将资料放入元件中
        @Override
        public View getView(int position, View convertView, ViewGroup parent) {

            convertView =inflater.inflate(R.layout.mylayout,null);

            ImageView imgLogo = convertView.findViewById(R.id.imgLogo);
            TextView txtName = convertView.findViewById(R.id.txtName);
            TextView txtPrice = convertView.findViewById(R.id.txtengName);

            imgLogo.setImageResource(imgIds[position]);
            txtName.setText(fastfood[position]);
            txtPrice.setText(price[position]);

            return convertView;
        }
    }

    public void onClick(View view) {
        show.setText(all);
    }
}



因为模拟器跑不出来图案..所以我再走一次

https://ithelp.ithome.com.tw/upload/images/20220202/20119035PelIkKfoaX.png
还是不能看到图案~不懂0.0

package com.huang.mylistview2;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

    String[] fastfood;
    String[] price;
    Context context;
    ListView listView;
    int[] imgIds ={R.drawable.f101,R.drawable.f102,R.drawable.f103,R.drawable.f104,
            R.drawable.f105,R.drawable.f201,R.drawable.f202};

    TextView show;
    String all ="";

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

        context =this;
        fastfood = getResources().getStringArray(R.array.fastfood);
        price = getResources().getStringArray(R.array.price);
        listView = findViewById(R.id.listView);
        show = findViewById(R.id.emptyView);

        MyAdapter adapter =new MyAdapter(context);
        listView.setAdapter(adapter);

        listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
        listView.setSelector(R.color.lvcolor);
        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                String s_name=fastfood[position];
                String s_price =price[position];

                all +=s_name+":"+s_price+"\n";

            }
        });


    }

    public class MyAdapter extends BaseAdapter{
       LayoutInflater inflater;

       public MyAdapter(Context c){
           inflater=LayoutInflater.from(c);
       }

        @Override
        public int getCount() {
            return fastfood.length;
        }

        @Override
        public Object getItem(int position) {
            return fastfood[position];
        }

        @Override
        public long getItemId(int position) {
            return position;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {

            convertView=inflater.inflate(R.layout.mylayout,null);
            ImageView imgLogo = convertView.findViewById(R.id.imgLogo);
            TextView txtName= convertView.findViewById(R.id.txtName);
            TextView txtPrice = convertView.findViewById(R.id.txtengName);

            imgLogo.setImageResource(imgIds[position]);
            txtName.setText(fastfood[position]);
            txtPrice.setText(price[position]);
            return convertView;
        }
    }

    public void onClick(View view) {

        show.setText(all);

    }
}

国际化
https://ithelp.ithome.com.tw/upload/images/20220203/20119035HHOpJ6jUqO.png

https://ithelp.ithome.com.tw/upload/images/20220203/20119035ROt2AGhDSH.png


<<:  Day 17 - Network Analyzers

>>:  Day17-Session 管理(一)

【Day7】情蒐阶段的小工具 ─ 扫描篇(一)

哈罗~ 今天要来跟大家介绍扫描的小工具 在介绍工具前,我们先来review一下TCP Flags。 ...

Day1 - 前言

前言 大家好,目前我学过C、java、lua等语言,但在android设计上还只能算是一名初学者,因...

Day25 - 补充 Container 和 Hashing

大家好,我是长风青云。今天是铁人赛的第二十五天。 突然发现我有些东西没说,而Hash这个我也忘记说,...

[Git] authentication with ssh key

Step1: 建立ssh公钥及私钥 安装git 传送门,打开git bash执行下列指令 ssh-k...

Swift纯Code之旅 Day10. 「TableView(2) - TableView Cell注册」

前言 昨天已经将addAlarmContentTableViewCell的元件都建立完毕了,但是画面...