跳至正文
-
Subscribe to our newsletter & never miss our best posts. Subscribe Now!
BG6RSH's 随记.

我们总是在感叹昨天,忽视今天,幻想着明天中渡过,且过且珍惜.....

BG6RSH's 随记.

我们总是在感叹昨天,忽视今天,幻想着明天中渡过,且过且珍惜.....

  • 首页
  • 论坛
  • 随记
  • 编程
  • 软件
  • 留言
  • 首页
  • 论坛
  • 随记
  • 编程
  • 软件
  • 留言
关

搜索

  • https://www.facebook.com/
  • https://twitter.com/
  • https://t.me/
  • https://www.instagram.com/
  • https://youtube.com/
Subscribe
编程

Android单击事件的两种方法

作者 admin
2011年3月1日 1 分钟阅读
0

刚开始还真搞不懂Android的编程风格,现在总算晓得了一点点,但跟DELPHI的编程风格来说,简直是太原始了。在DELPHI中用鼠标双击的工作,没想到在Android中要输入这么多代码。也许在Android中有方便的方法,但我现在还不知道!

Java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
public class MainActivity extends Activity {  
 
    @Override  
    protected void onCreate(Bundle savedInstanceState) {  
        super.onCreate(savedInstanceState);  
        setContentView(R.layout.activity_main);  
        final EditText editText = (EditText) findViewById(R.id.editText1);  
 
        OnClickListener listener = new Button.OnClickListener() {  
            @Override  
            public void onClick(View v) {  
                setTitle("您的标题是:" + editText.getText()  
                        + (Button) v.findViewById(R.id.button2));  
                editText.setText(null);  
                for (int i = 0; i < 5; i++)  
                    editText.append("您的答案是:" + i + "!\n");  
            }  
        };  
        findViewById(R.id.button1).setOnClickListener(listener);  
 
        findViewById(R.id.button2).setOnClickListener(new OnClickListener() {  
 
            @Override  
            public void onClick(View v) {  
                // TODO Auto-generated method stub  
                editText.append("aaa");  
            }  
        });  
    }  
 
    @Override  
    public boolean onCreateOptionsMenu(Menu menu) {  
        // Inflate the menu; this adds items to the action bar if it is present.  
        getMenuInflater().inflate(R.menu.activity_main, menu);  
 
        return true;  
    }  
}

标签:

Android
作者

admin

关注我
其他文章
上一个

学习笔记:Android控件ListView的简单使用方法。

下一个

支票快打2005注册器

暂无评论!成为第一个。

发表回复 取消回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理。

4条垃圾评论已被Akismet阻挡 (在新标签页中打开)

近期文章

  • www.tansoo.cn网站空间迁移至armbian主机
  • 在QT6中安装qtmqtt、qtopcua控件的方法
  • 你的 Python 环境或安装版没有 spyder‑kernels 模块或没有安装正确的版本 (>=
  • 用PYTHON爬网络小说源代码
  • QT5.15.2搭建ANDROID编译环境

近期评论

  • gg 发表在《Traccar服务软件高德地图适配版docker镜像安装教程》
  • admin 发表在《Traccar服务软件高德地图适配版docker镜像安装教程》
  • /api/positions/里addres 为什么是null啊? 发表在《Traccar服务软件高德地图适配版docker镜像安装教程》
  • gg 发表在《Traccar服务软件高德地图适配版docker镜像安装教程》
  • 9394 发表在《Traccar服务软件高德地图适配版docker镜像安装教程》

归档

  • 2025 年 6 月
  • 2023 年 6 月
  • 2022 年 10 月
  • 2021 年 5 月
  • 2021 年 4 月
  • 2020 年 11 月
  • 2020 年 10 月
  • 2020 年 6 月
  • 2019 年 11 月
  • 2019 年 8 月
  • 2019 年 6 月
  • 2019 年 1 月
  • 2018 年 12 月
  • 2018 年 11 月
  • 2017 年 9 月
  • 2016 年 7 月
  • 2016 年 5 月
  • 2015 年 12 月
  • 2015 年 4 月
  • 2015 年 1 月
  • 2014 年 12 月
  • 2014 年 11 月
  • 2014 年 10 月
  • 2014 年 9 月
  • 2014 年 8 月
  • 2014 年 7 月
  • 2014 年 6 月
  • 2014 年 5 月
  • 2013 年 10 月
  • 2013 年 9 月
  • 2013 年 8 月
  • 2013 年 7 月
  • 2013 年 6 月
  • 2013 年 5 月
  • 2013 年 4 月
  • 2013 年 3 月
  • 2013 年 2 月
  • 2013 年 1 月
  • 2012 年 12 月
  • 2012 年 11 月
  • 2012 年 10 月
  • 2012 年 6 月
  • 2012 年 3 月
  • 2011 年 8 月
  • 2011 年 5 月
  • 2011 年 4 月
  • 2011 年 3 月
  • 2011 年 1 月
  • 2010 年 8 月
  • 2010 年 6 月
  • 2010 年 4 月
  • 2010 年 3 月
  • 2010 年 2 月
  • 2010 年 1 月
  • 2009 年 12 月
  • 2009 年 11 月

分类

  • 编程
  • 软件
  • 随记

其他操作

  • 注册
  • 登录
  • 条目 feed
  • 评论 feed
  • WordPress.org

标签

aliyun Android CRC DBGridEh ddns Delphi EhLib ESP8266 GP328D gp338plus GP3688 Modbus phpbb python QT raspberry S7-SCL sapi speech SpVoice Synology traccar UART Unicode virtualbox vmware WGS84 wordpress ZeroTier 写频 动态IP 图片尺寸 地图 外挂编程 天气预报 导航 打印 扩频 拼音首字母 支票快打 树莓派 爬虫 百度地图 西门子PLC 车联网API

友情链接

  • 私有云论坛
  • 百度开放云
  • 主机管理
  • My Cloud
  • 智能家居技术论坛
  • 精灵云
  • 雅苑私站
Copyright 2026 — BG6RSH's 随记.. All rights reserved. Blogsy WordPress Theme