Android ApiDemos示例解析(102):Views->Auto Complete->4. Contacts

android AutoComplete 自动匹配所有选项控件 android AutoComplete 自动匹配所有选项控件 和网页中的下列框类似,并且实现了ID和Name的对应关系 可以在些基础上做些修改满足不同的需要。 立即下载

AutoCompleteTextView 的setAdapter方法:

public                                             void      setAdapter(T adapter)

设置自动提示下拉框的提示例表,为一Adapter 类型 ,为支持filterable list 的Adapter ,常见的实现了Filterable 的Adapter由ArrayAdapter , CursorAdapter, SimpleAdatper, SimpleCursorAdapter 等。

应用需要负责管理Adapter 涉及到的资源,因为AutoCompleteTextView 关闭时不会通知adapter, 比如应用必须释放CursorAdapter 包含的Cursor资源。可以通过startManagingCursor()自动管理cursor 或是在AutoCompleteTextView 关闭时手工释放Cursor。

本例使用CursorAdapter 使用 ContentResolver 读取通讯录中联系人作为提示框内容来源,关于 ContentResolver 和Contact List 用法请参见 Android ApiDemos示例解析(10):App->Activity->QuickContactsDemo

本例使用ContactListAdapter 支持使用* 通配符来匹配所有联系人,因*字符长度为1,此时需要使用android:completionThreshold:

<AutoCompleteTextView android:id=”@+id/edit”
android:completionThreshold=”1″
android:layout_width=”match_parent”
android:layout_height=”wrap_content”/>

然后为AutoCompleteTextView 设置adapter.

AutoCompleteTextView textView = (AutoCompleteTextView)
 findViewById(R.id.edit);
textView.setAdapter(adapter);


 

 

 

 

 

AutoComplete控件的使用方法 1.使用AutoComplete控件实现网页自动填充。仿照百度首页的自动填充。 2.创建数据表Book_info的表,添加数据往里面 3.打开AJAX Extendions选项卡,双击ajax中核心组件ScriptManager 4.打开AJAX Extendions选项卡,双击ajax中核心组件ScriptManager 5.设置AutoCompleteExtender的部分属性 CompletionInterval="100" MinimumPrefixLength="1"rvicePath="WService.asmx" UseContextKey="True" ServiceMethod="GetCompletionList" 6.添加webservice,写GetCompletionList的方法 立即下载

相关推荐

Cobalt Strike4.0安装包(内附中文版)

1.什么是 Cobalt Strike Cobalt Strike 是一个为对手模拟和红队行动而设计的平台,主要用于执行有目标的攻击和模拟高级威胁 者的后渗透行动。 Cobalt Strike已经不再使用MSF而是作为单独的平台使用,它分为客户端与服务端,服务端是一个,客户端可以有多个,可被团队进行分布式协团操作。集成了端口转发、扫描多模式端口Listener、Windows exe程序生成、W...

梦之序章的博客 2万+

Android开发之--Auto Complete TextView的使用

步骤: 1.在布局文件中声明Auto Complete TextView; 2.定义提示条目的样式(在布局文件中新建一个xml文件,声明一个TextView控件,给其设置样式); 3.创建一个ArrayAdapter(AutoCompleteTextView需要使用ArrayAdapter提供数据); 4.为autoCompleteTextView设置数据

jcy472578的专栏 1783

Minitab田口设计实战:如何用正交试验优化遗传算法参数(附完整操作步骤)

本文详细介绍了如何利用Minitab田口设计进行遗传算法参数优化,通过正交试验方法显著提升效率。文章涵盖实验设计、Minitab操作步骤、结果分析及高级技巧,帮助工程师快速掌握这一工业级优化技术,实现算法性能的显著提升。

wind6的博客 866

测试工作经验总结3:简短的总结?

写了这么多,都不知道写的啥!!!!!!!太乱了!

Henryztong的博客 3390

显著性算法 + 伪彩变换

利用opencv得到显著图和伪彩图

正在挣扎中的人 2301

手把手教你用Siemens EDA破解工具搞定PADs VX2.7安装与卡死问题

本文详细介绍了如何使用Siemens EDA工具解决PADs VX2.7的安装与卡死问题。从License配置到性能调优,提供全面的解决方案,帮助工程师高效完成电子设计自动化任务。特别针对常见的卡顿现象,给出了输入法兼容性调整、图形性能优化等实用技巧。

k8l9m0n的博客 556

Android ApiDemos示例解析(103):Views->Auto Complete->5. Contacts with Hint

上例使用Contacts中联系人作为AutoCompleteTextView 的提示内容时,使用了另外一个文本框来提示用户可以使用 * 作为通配符来匹配所有联系人: 本例介绍了AutoCompleteTextView 的 completionHint 属性用法,提供设置completionHint 属性,提示信息可以直接显示在提示下拉框中: android:completionThre

引路蜂移动软件 4826

沧小海深入剖析xilinx的GTP/GTX核,掌握高速串行收发机制——第六章 接收端结构及功能说明

总目录在这哦~ https://blog.csdn.net/z123canghai/article/details/107700878 第六章 接收端结构及功能说明 子目录 6.1 RX的模拟前端 6.2 RX的OOB信号 6.3 RX的均衡器 6.4 RX的CDR 时钟数据恢复 6.5 RX时钟输出结构 6.6 RX 的极性控制 6.7 RX 的PRBS 6.8 Rx字节、字的对齐功能 6.9 Rx接收弹性缓冲区 6.10 Rx的时钟纠正 6.11 Rx接收通道绑定 6...

滄海的博客 1万+

Android Visualizer 实战:把声音画出来

是系统提供的音频效果(AudioEffect)之一。它挂在音频链路上,,把数据回吐给你——画波形、画频谱、做响度表。

Android的专栏 323

QGIS将经纬度坐标转成点

QGIS绘制一张地图

weixin_46713695的博客 6056

第23章:代码迁移——用AI将Vue2迁移到Vue3、将JS迁移到TS

> - 用AI自动将Vue2 Options API转为Vue3 Composition API的完整流程 > - 将JavaScript项目批量迁移到TypeScript,自动添加类型推导 > - 处理依赖冲突、破坏性变更和迁移后的验证方法 > - 一个完整的Vue2到Vue3迁移案例(含路由、状态管理) > - 我如何用AI将公司一个10万行代码的老项目从JS升级到TS

sfishfly的博客 209

PHP多维数组排序完全指南

需求:订单按「待付款 → 待发货 → 已完成 → 已取消」排,而不是按字典序。??});用??给未知状态兜底,避免警告。/*** 多字段排序(usort 版,支持保留键名与自定义比较器)* 用法:* @param array $list 待排序数组* @param array $rules [字段名, 方向 asc|desc, 类型 numeric|string|natural|regular]* @param bool $keepKeys 是否保留键名(true 用 uasort)

qq_19716091的博客 234

EtherCAT从站EEPROM组成信息详解(2):字8-15产品标识区

以实际的从站EEPROM数据为例,参照EtherCAT的SII规范,详细分析了从站EEPROM字8-字15的产品标识区内容组成。

kevin1499的博客 719

Android 开发入门实践(十三):用 Intent、UiState 和 Reducer 理解 MVI 的状态更新

本文记录第141—145课对MVI架构的入门实践,通过“返回列表”功能逐步构建意图(NewsIntent)、状态(NewsUiState)与状态转换(reduce)机制。基于单向数据流,用户操作生成意图,ViewModel通过Reducer根据旧状态计算新状态,并通过StateFlow更新Compose界面。代码实现清晰分离关注点,强化了对状态管理、事件驱动与数据流的理解。

Easyhood的博客 359

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

RK-RK3572-Android16- 编译打包优化-OTA整包-差分包打包

这里主要记录一下 RK3572 在Android16 上面进行OTA升级的整包和差分包制作经验的一个分享,整理知识点,方便后续自己和其它同事开发提高工作效率、直接使用。不管哪一个平台,MTK 也好、RK也好 基本上都是不同Android版本各个子系统之间还是有一点点区别的,所以有必要记录整理知识点,方便提高开发效率、生产效率。针对OTA升级问题 ,再一次说明还是要看官方提供的文档,按照文档来。

十年饮冰,难凉热血 215

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

安卓APK下载后安装全流程:从点击下载到第一次启动,每一步的检查点

这套流程听起来繁琐,但真正需要每次都做的只有来源核对和签名校验两步,其他都是出问题时才查。养成习惯之后,能挡掉绝大多数"装了垃圾包""装完闪退"的情况。如果要省事,直接用这类会标注包名、版本号和校验信息的站点,比在搜索结果里挨个试要稳得多。

qq362196705的专栏 205

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

Android Laya 与 Native Bridge:页面识别、双向通信、协议设计和崩溃定位

Laya 与 Native 通信的难点不在于某个或的写法,而在于边界:页面来源是否可信、协议是否明确、线程是否正确、请求是否幂等、页面是否仍然存在、日志是否能关联一次完整请求。建立这些边界后,才能把“页面白屏”“按钮无响应”“重复消息”和“Native 崩溃”拆成可验证的层次,并沿着真实调用链找到根因。

路在脚下,幸福在手中,莫贪!!!!! 168

BUUCTF-菜刀流量-MISC-学习笔记

从 1970-01-01 00:00:00 UTC 起算的秒数,——Wireshark 直接告诉你它回答的是谁;由表可知道,96帧返回了flag.rar。, 代表删除键,先删了4次,又删了1次。所以密码是:SuperMaster。解析128帧的响应,即133帧。所以这是一个标准抓包文件,用。解压压缩包拿到html代码。:选中 128 帧,展开。:128 和 131 的。能把一问一答放在一起看;是八进制(Oct)的数字。(或 TCP 层)看到。对比一下ASCii 码表。

晓梦林的博客 86

Android 音频 Player 体系

Android 音频框架中,"Player"是统一抽象的音频播放实例,涵盖 AudioTrack、MediaPlayer 等。每个 Player 由唯一 piid 标识,通过 PlayerBase 注册至 PlaybackActivityMonitor,状态机管理其生命周期(idle→started→stopped→released)。关键事件如 portId 绑定、静音(位掩码标识主静音、音量为0等)、设备切换等均通过 PLAYER_UPDATE_* 通知系统。静音原因以掩码形式记录,日志中“source

aningxiaoxixi的博客 168

Harness篇|DeepSeek Harness 上手机:五条安卓移植路线与 App 内 Linux 拆解

DSH 官方没出安卓版,火的全是社区第三方移植。本文拆解真实卡点(glibc vs Bionic)、两种「App 内 Linux」的实现(PRoot 与 seccomp 容器),以及「真沙箱」的三层边界与衡量标准。

AI_Gump的博客 396
上一篇: Android ApiDemos示例解析(101):Views->Auto Complete->3. Scroll
下一篇: Android ApiDemos示例解析(103):Views->Auto Complete->5. Contacts with Hint
引路蜂
博客等级 码龄16年 3122粉丝 711原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值