登录
首页 » Android » Android MyThread线程用法实例 切换图片

Android MyThread线程用法实例 切换图片

于 2022-03-24 发布 文件大小:814.60 kB
0 118
下载积分: 2 下载次数: 1

代码说明:

Android 使用MyThread创建线程,这是用法实例源码,本例中使用线程来控制切换图片   public void onCreate(Bundle savedInstanceState) {//重写的onCreate方法    super.onCreate(savedInstanceState);    setContentView(R.layout.main);//设置当前的用户界面    myImageView = (ImageView) findViewById(R.id.myImageView);//得到ImageView的引用    MyThread myThread = new MyThread(this);//初始化MyThread线程    myThread.start();//启动线程   }   public void run() {//重写的run方法    while(true){//循环    activity.myHandler.sendEmptyMessage((what++)%4);//发送消息    try{    Thread.sleep(2000);//睡眠    }    catch(Exception e){//捕获异常    e.printStackTrace();//打印异常信息    }    }   }

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • googlelocation
    用Android studio配置谷歌地图,实现坐标定位并显示。(Configure Google Map with Android studio to achieve coordinate positioning and display.)
    2019-04-05 20:54:55下载
    积分:1
  • Android视频传输
    Android端代码和计算机端Java代码,实现了手机视频向计算机端的传输,计算机端可以拍照
    2013-05-02下载
    积分:1
  • android lua 在java 中的应用实例
    androlua 使用示例框架
    2014-07-02下载
    积分:1
  • Android API人脸检测范例代码
    Android API人脸检测范例代码,打开一张含有人脸的照片,程序会自动识别人脸区域,在人的眼睛区域标识出红圈,看着更像是人眼检测,哈哈。这个人脸检测是静态的,也就是打开图片识别,并不能实现像手机取景时的人脸识别功能,仅供参考。
    2022-06-16 10:41:00下载
    积分:1
  • service前台服务
    前台服务和普通服务的最大区别在于,它会一直有一个正在运行的图标在系统的状态栏显示,下拉状态栏后可以看到更加详细的信息,非常类似于通知的效果。比如墨迹天气,它的服务在后台更新天气数据的同时,还会在系统状态栏一直显示当前的天气信息。
    2022-08-07 22:37:39下载
    积分:1
  • RoundImageView
    应用背景图片可从网上获取,也可自定义为本地。实现将图片裁剪成圆形图片或圆角方形,根据图片大小,最多定义2个边框。最后将裁剪后的圆形图片保存在本地。代码比较明确,非常适合新手学习。关键技术canvas,自定义View,对Bitmap的压缩,裁剪,保存本地,缓存读取处理。
    2022-03-10 07:35:41下载
    积分:1
  • qiangtandenglu
    《抢滩登陆》属于即时360度全方位射击游戏,相对于同类游戏较为简单,但容量又大于普通的小游戏,玩法非常简单,很容易上手。游戏情节惊心动魄,游戏场景中变化多端的敌军、即时控制的动作都是吸引玩家的亮点。 20世纪60年代,战争的硝烟在整个欧洲大陆上弥漫,盟军在大陆上的作战陷入了胶着状态。为了牵制敌军的行动并最终取得决定性的胜利,玩家的使命就是:尽最大可能消耗敌人的入侵部队,阻止敌人的进攻。面对滩头上潮水一般涌来的敌人,唯一能依靠的就只有身后那门威力无比强大的海防炮台。 android游戏(Landing on a beach belonging to real-time 360-degree shooting game, it has a relatively simple compared to similar games, but the capacity is greater than the ordinary game play is very simple, very easy to use. The game plot thrilling, varied enemy in the game scene, real-time control actions are the highlights to attract players. 1960s, the war on the entire European continent, filled the air, the Allied forces fighting on the mainland into a stalemate. In order to pin down the enemy' s actions and ultimately to achieve a decisive victory, the player' s mission is: to the maximum extent possible consumption of the invading forces of the enemy, to prevent the enemy' s attack. The face of the enemy beachhead came flooding, only able to rely on only behind that door power of powerful coastal defense fort. android game)
    2012-07-08 08:36:56下载
    积分:1
  • fdx
    开发安卓短信软件,短信收取,发送,等简单功能(Android SMS software development, SMS received, sent, and other simple functions)
    2014-05-04 20:35:20下载
    积分:1
  • android系统 ContactsProvider模块源码下载
    android系统 ContactsProvider模块源码下载
    2014-10-27下载
    积分:1
  • 安卓身份证读取模块
    安卓身份证读取模块
    2020-12-01下载
    积分:1
  • 696518资源总数
  • 105554会员总数
  • 2今日下载