首页 > 系统 > Android > 正文

Android 开启一个新线程

2019-11-09 17:25:54
字体:
来源:转载
供稿:网友
package com.example.che;import android.os.Bundle;import android.app.Activity;import android.util.Log;import android.widget.TextView;public class MainActivity extends Activity { TextView tv01; @Override PRotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); tv01=(TextView) this.findViewById(R.id.wenzi); yunXing(); } public void yunXing(){ new Thread(){ public void run() { Log.i("xuhaitao", "子线程打印"); } }.start(); //开启一个线程 } }

这里写图片描述


Log输出如下: 这里写图片描述



FR:海涛高软(QQ技术群:386476712)


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表