0 Star 1 Fork 1

ymz / Application

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
ViewActivity.java 886 Bytes
一键复制 编辑 原始数据 按行查看 历史
ymz 提交于 2021-09-11 11:38 . 整理项目结构
package com.example.myapplication.threadcheck;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.example.myapplication.base.BaseActivity;
public class ViewActivity extends BaseActivity {
private static final String TAG = "ViewActivity";
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView textView = new TextView(this);
textView.setText("Hello, World!");
setContentView(textView);
textView.setOnClickListener(this::onClick);
}
private void onClick(View view) {
if (!(view instanceof TextView)) {
return;
}
TextView textView = (TextView) view;
new Thread(() -> {
textView.invalidate();
}).start();
}
}
Java
1
https://gitee.com/2820174512/application.git
git@gitee.com:2820174512/application.git
2820174512
application
Application
master

搜索帮助