Intent.createChooser

Intent.createChooser方法源码解析(按我的解析,只有一个Intent是不会启动的??Android源码7.1.2) 用法: intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); Intent chooserIntent = Intent.createChooser(intent, "分享到:"); VActivityManager.get().startActivity(chooserIntent, 0); 来看下源码: public static Intent createChooser(Intent target, CharSequence title) 阅读详情

 平常在玩应用的时候,比如你现在登录的是QQ  ,你可能要看QQ空间的信息,又因为QQ不知道是哪个版本的,还必须通过浏览器查看

这时候你点击那个连接时 :弹出两个浏览器 一个UC 一个QQ 默认浏览器,他让你选择,当时在玩的时候他是怎么样做到的,今天在别人的一篇文章中

看到了

startActivity(Intent.createChooser (xx,xx));


 刚开始很纳闷 !这是干嘛用的!

看了下官方的文档:

Convenience function for creating a ACTION_CHOOSER Intent. 

Parameters:
target The Intent that the user will be selecting an activity to perform.
title Optional title that will be displayed in the chooser.
Returns:
Return a new Intent object that you can hand to Context.startActivity() and related methods.

看的不是很明白 ,直接上手写了一个:

public void buttonClick(View view){
		Intent intent =new Intent(Intent.ACTION_SET_WALLPAPER);
		startActivity(Intent.createChooser(intent, "choose"));
		
	}



 一点击这个button 效果出现了,就是我前面说的的那效果:

一看图大家明白了是干什么用的吧。

 

一个不能说明什么:在来一个发短信的

 Intent share = new Intent(android.content.Intent.ACTION_SEND);
          share.setType("text/plain");                                //确定数据格式                            
            share.putExtra(Intent.EXTRA_SUBJECT, "Title");    //添加附加信息
            share.putExtra(Intent.EXTRA_TEXT,"helloffff");
          startActivity(Intent.createChooser(share, "其他转发方式"));  

 我觉得这个还很有意思的! 大家也多看看

 

山东大学机器学习(实验一内容)——线性回归 1. 描述 第一个练习将为你提供线性回归练习。这些练习已经用Matlab进行了广泛的测试,但它们也应该在Octave中工作,它被称为“免费版的Matlab”。如果你使用的是Octave,那就是 一定要安装Image包(可在Windows中作为选项使用)安装程序,可从Octave-Forge获得Linux。 2.线性回归 回想一下,线性回归模型是 hθ(x)=θTx=∑j=0nθjxj h_{\th... 阅读详情

相关推荐

DNS入侵检测 datacon2020

DNS入侵检测 datacon2020。

weixin_51491521的博客 527

Intent.createChooser()

系统提供的分享实现代码如下: Intent send = new Intent(Intent.ACTION_SEND); send.setType("text/plain"); send.putExtra(Intent.EXTRA_TEXT, url); send.putExtra(Intent.EXTRA_SUBJECT, title); c.startActivity(In...

qq_32534441的博客 7045

计算光刻效率革命:为什么Hopkins模型比Abbe模型快?深入解析TCC的魔力

本文深入解析了计算光刻中Hopkins模型相比Abbe模型的效率优势,重点探讨了TCC(透射交叉系数)的工程智慧。通过预计算光学系统特性并复用TCC矩阵,Hopkins模型实现了数量级的加速,特别适用于复杂照明条件下的光刻仿真。文章详细介绍了TCC的物理意义、模态分解技术以及GPU并行计算等关键加速策略,为半导体制造中的光刻工艺优化提供了实用见解。

weixin_33364627的博客 399

Intent.createChooser()的使用

先看效果图: /**我这写了一个方法 * @param context * @param sharedText 分享时的内容,就是图片2中的:这个是要分享的内容 */ public static void toShare(Context context, String sharedText) { //Intent.ACTION_SEND:act

qq_33863058的博客 1444

SLAM算法的优缺点

SLAM(Simultaneous Localization and Mapping,同时定位与地图构建)算法是一种通过传感器数据实时估计机器人自身位置和构建环境地图的技术。

selenia8860的博客 2918

halcon 查找圆形

先找到大概位置进行拟合,然后再以拟合出的位置作为测量的大概位置进行找圆;

qq_59062726的博客 743

createchooser应用选择器

createchooser应用选择器 当我们通过隐式Intent调用Android组件时,系统会根据条件进行过滤,如果有多个组件满足条件,则会弹出选择框,提示用户用那种方式打开。 例如执行如下代码,会弹出选择框。 Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("text/plain"); ...

salary的专栏 5049

层层剥开Allegro skill--快速抓取并写入Allegro软件【呕血创作,转载注明】

Allegro skill eda pcb

qq_36492361的博客 1287

Android 开发之:Intent.createChooser() 妙用

Intent.createChooser(ntent target, CharSequence title) 其实 大家对该功能第一影响就是ApiDemo 里面的 其只有区区几行代码  提取为:  ? 1 2 3 Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.se

wu_wenhuan的专栏 3376

WPF中使用TreeView封装组合控件TreeView+DataGrid

wpf的功能非常强大,很多控件都是原生的,但是要使用TreeView+DataGrid的组合,就需要我们自己去封装实现。功能如上图所示, 目前基本上把常用的样式都实现了,购买源码后,可以自行修改样式。本文源码效果如下,(搞了好几天,的确有难度,所以源码也收费,便宜,赚点辛苦费)第一种:技术的选择是TreeView(也就是本文的演示)。这2个图都是第三方控件自带的,并且都是收费使用。首先说明一下,实现上面的效果,有3种方法。本文演示的是使用TreeView的实现。第二种:技术的选择是DataGrid。

故里2130 1657

最新Python爬虫实战(入门爬虫篇)——案例1:某瓣网站Top250图片数据采集(附上完整爬虫代码)

本次案例通过Python爬虫技术实现了某瓣Top250电影封面的批量下载。代码采用模块化设计,函数实现cookies的自动解析,简化了配置流程,涵盖请求、解析、存储的完整流程。学习重点包括:抓包工具定位数据源、正则表达式匹配图片链接、模拟请求头绕过反爬机制、以及自动化文件管理。需要注意控制请求频率并遵守网站使用规范,适用于入门爬虫实践。

努力让自己发光,对的人才能迎着光而来 16万+

Android Intent.createChooser()

Intent.createChooser(ntent target, CharSequence title)  其实 大家对该功能第一影响就是ApiDemo 里面的 其只有区区几行代码 提取为:  Java代码  Intent intent = new Intent(Intent.ACTION_GET_CONTENT);  intent.setType("audio/*");  startActivity(Intent.createChooser(intent, "Select music"));  Int

bigapple88的专栏 5547

基于simulink的电气弹簧ES稳压控制模型仿真

若要补偿母线电压的谐波,需控制ES上的谐波,即在单闭环母线电压有效值控制的基础上,增加谐波抑制环节来进行谐波控制,现有的各种检测和抑制谐波的方法有采用模拟滤波器、傅里叶分析进行谐波分析、基于瞬时无功功率理论的方法等。当关键负载ZC为电流源型非线性负载时,电路原理图如图7所示,由于电流源型非线性负载可以等效为谐波电流源,关键负载电流ic便会含有谐波分量,导致输电线电流is和母线电压VS同样会含有谐波分量,导致供电质量的严重下降,对用电设备的正常工作造成影响。分别为流过线路阻抗、非关键负载、关键负载的电流,

FPGA/MATLAB学习教程/源码/项目合作开发 1639

Intent.createChooser 应用选择器

原文地址  http://blog.csdn.net/heng615975867/article/details/18983317 简单的分析了一下源代码,在 [java] view plaincopy final Intent pickWallpaper = new Intent(Intent.ACTION_SET_WALLPAPER

Barving的专栏 859

InTheHand.Net.Personal+BlueTooth4,蓝牙开发

项目中有蓝牙开发的必备dll,现在网上相关的文档博客不少,有的说的多有的说少,但是却很少有这两个dll,分享一下。

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

主题:Intent.createChooser() 妙用

Intent.createChooser(ntent target, CharSequence title)  其实 大家对该功能第一影响就是ApiDemo 里面的 其只有区区几行代码  提取为:Intent intent = new Intent(Intent.ACTION_GET_CONTENT);intent.setType("audio/*");startA

独自登高楼 望断天涯路 1万+

深度学习工具包 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")

Intent.createChooser() 妙用

Intent.createChooser(ntent target, CharSequence title)     其实 大家对该功能第一影响就是ApiDemo 里面的 其只有区区几行代码  提取为:   Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType("audio/*"); startAc...

我的实验室 贡献我们智慧于网络 213

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

Android------Intent.createChooser

Intent的匹配过程中有三个步骤,包括Action , category与data 的匹配。如果匹配出了多个结果,系统会显示一个dialog让用户来选    择。如下图:      那么今天我们主要是讲解一下,如何自定义这个Chooser的标题?      代码其实很简单,如下: Intent intent = new Intent(Intent.ACTION_GET_CO

小欣儿的专栏 1678

Android Intent.createChooser() .

Intent.createChooser(ntent target, CharSequence title)   其实 大家对该功能第一影响就是ApiDemo 里面的 其只有区区几行代码 提取为:   Java代码   Intent intent = new Intent(Intent.ACTION_GET_CONTENT);   intent.setType("audio/*");  

璐璐的专栏 1221

Launcher源码中Intent.createChooser()实现原理及小例子

在上一篇中,简单的分析了一下源代码,在 view plain final Intent pickWallpaper = new Intent(Intent.ACTION_SET_WALLPAPER);           Intent cho

101

android Intent.createChooser 应用选择器

参考:http://www.iteye.com/topic/690376  http://www.cnblogs.com/wservices/archive/2010/07/07/1772737.html  http://hi.baidu.com/lck0502/blog/i

122

Intent.createChooser方法在HTC OneX上意外会引发onConfigurationChanged方法

android就是这点不好,机型太多,什么奇怪的Bug都有。今天又遇上一个,是说在A界面编辑本地联系人返回后会返回到B界面(B界面为默认界面)。A和B界面都受一个父Acitivy管理,类似像Tab页一样嵌入其中。 最后找到问题代码: startActivityForResult(Intent.createChooser(intent, getString(R.string.menu_newCo

lilybaobei的专栏 3384

如何自定义Intent.createChooser的显示结果

Intent是android核心的概念之一,Intent为android系统提供了真正的开放。android的姿态是开放了,但却没有做到位。 拿“发邮件”这一功能来说,为了使用Intent机制来发送邮件,调用方需要知道Intent的规则,如action、uri、MIME type和category。但是在哪里能找到这些规则呢?官方文档里没有,还好能求助google,然后就发现StackOv

cmoaciopm的专栏 5655

Intent中createChooser方法的使用

当我们使用如下代码的时候可能会遇到这种情况 Intent it = new Intent(Intent.ACTION_VIEW); startActivity(it); 应为android程序中有很多Activity使用的ACTION_VIEW作为action。所以会打开如下画面。 当我们使用如下代码的时候就会开启不同标题的同一个画面。 Intent it

jerboy的专栏 1398
上一篇: Android杂谈--代码混淆及proguard一些错误处理
下一篇: android TraceView使用以及listview 的性能优化测试(一)
廖益平
博客等级 码龄16年 120粉丝 137原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值