**android Intent 的Componet ,Action ,Category,Data,Type,Extra,Flag 7种属性详解

安卓中各种intent的详细介绍 安卓中各种intent的详细介绍 String ADD_SHORTCUT_ACTION 动作:在系统中添加一个快捷方式。 String ALL_APPS_ACTION 动作:列举所有可用的应用。 立即下载

android Intent 的Componet ,Action ,Category,Data,Type,Extra,Flag 7种属性详解

一、Componet : 用于指出启动的组件(实现页面的跳转)
注:因为componet制定了要启动的组件。所以intent叫显式intent

Componet Name(String pkg,String cls)
Componet Name(Context pkg,String cls)
Componet Name(Context pkg,Class

示例代码
//创建一个Component对象。
ComponentName componentName=newComponentName("com.example.包名", "com.example.intenttest1.SecondActivity");
                Intent intent =new Intent();
                intent.setComponent(componentName);
                startActivity(intent);



最常用的跳转方法

setClass(Context pkg,Class

示例代码
Intent intent =new Intent();        intent.setClass(MainActivity.this,SecondActivity.class);
startActivity(intent);

二、Action 、Category 属性和intent-filter的使用

注:因为使用action没有明确指定要启动action,故,intent为隐式intent

  1. Action 和 Category 是intent-filter的子元素
   <activity
            android:name="com.example.intenttest1.SecondActivity"
            android:label="@string/title_activity_second" >

            <intent-filter >
               <action android:name="com.包名.aa"/> 
               <category android:name="android.intent.category.DEFAULT" />

            </intent-filter>
 </activity>

2.用隐式 intent 去启动其他的组件(此处以一个Activity 启动另一个Activity为例)

当前activity中要用intent设置action。
注:1.此处没有设置category,就是使用系统默认的category
    2.使用这种方法依据可以使用intent传递参数

                Intent intent =new Intent();
                intent.setAction("com.包名.aa");
                intent.addCategory("hello");
                intent.putExtra("hello", "hello");
                startActivity(intent);

在清单文件中。对要启动的activity进行设置,

   <activity
            android:name="com.包名.要启动的Activity"
            android:label="@string/title_activity_second" >
            <intent-filter >
               <action android:name="com.包名.aa"/> 
               <category android:name="hello" />

               <!--第一个activity虽然使用了默认的category,但是 必须写上,否则报错 -->
               <category android:name="android.intent.category.DEFAULT" />

            </intent-filter>
   </activity>

总结:1.隐式intent的就是系统根据intent的action和category去确定要启动的组件。不管有没有制定category,清单文件中要启动的组件 必须写上默认的 否则会报错文件找不到
2. 中的action和category可以有多个。表明该组件可以响应多个intent。

技术美术个人笔记(十六)——Houdini到UE的大地形 文章目录关于地形白模制作关于PDG流程 关于地形白模制作 用heightfield noise和笔刷刷出合适的mask做山形叠加: 用remap可快捷反转mask ,用来做平原地区的小型丘陵: 接着用clip切平最低处,用distort制造侵蚀等,对部分地区用笔刷进行微调拓宽峡谷: 用经过sweep打平的曲线以及裁切的各种多面体用heightfield_project投影制作河道和水池,用blur mask并remap的方法拓宽河道 用distort、erode制造合适的弯曲和侵蚀,同理可挖出月牙形 阅读详情

相关推荐

记录思科cisco交换机升级iso步骤

Cisco Nexus 93180交换机版本升级

a635161812的博客 4384

android Intent对应的category列表

1.android.intent.category.BROWSABLE 指定在浏览器中的动作。当 Intent 在浏览器中被引发,都会被指定成 BROWSABLE 种类。 2.android.intent.category.DEFAULT 设置这个种类来让组件成为 Intent Filter 中定义的 data 的默认动作。这对使用显式 Intent 启动的 Activity 来说也是必要的

danruochen的专栏 2755

晶圆测试(Wafer Sort)的核心技术与良率提升策略

晶圆测试(Wafer Sort)是芯片制造中的关键“入学考试”,通过探针台与自动测试设备(ATE)对晶圆上的芯片进行功能与参数测试,筛选不合格芯片以控制成本。本文深入解析了其核心技术,包括自动化视觉系统对准、测试流程优化策略,并探讨如何利用测试数据驱动良率提升,展望了DFT与AI智能测试的未来趋势。

e4f5g6h的博客 527

APP跳转到第三方应用

第一种方式: 知道要跳转的第三方应用的包名和要跳转到的activity的名字,得用 Intent intent = new Intent(); ComponentName component = new ComponentName(包名,要跳转的activity路径); intent.setComponent(component ); 或 intent.setClass(包名,要跳...

liuye066的专栏 4050

告别枯燥的Unity编辑器脚本:Odin插件如何让游戏数据配置变得像搭积木一样简单?

本文详细介绍了Odin插件如何简化Unity编辑器脚本开发,使游戏数据配置变得直观高效。通过声明式特性和丰富的可视化工具,Odin让开发者告别繁琐的OnGUI代码,实现所见即所得的开发体验。文章重点展示了Odin的核心优势、魔法特性及实战案例,帮助Unity开发者提升工作效率。

weixin_28717411的博客 355

【数据集】全球陆地表面反照率Albedo

【数据集】全球陆地表面反照率Albedo

WW、forever的博客 1457

android.intent.category.BROWSABLE

参考: http://blog.csdn.net/annkie/article/details/8349626 http://xiechengfa.iteye.com/blog/1004991 BROWSABLE的意思就是浏览器在特定条件下可以打开你的activity: 举例1:我有一个activity,它注册了能显示pdf文档,AndroidManifest.xml内容如下:...

2102

WOFOST作物模型(1):PCSE环境配置

get_summary_output() 方法通常用于在 PCSE 模拟过程结束后,获取模拟结果的摘要信息,例如模拟期间的总产量、总水分需求等。它可以提供对模拟结果的快速总结,方便用户进行后续的分析和处理。用.get_output来获取过程参数,并将这些参数转为dataframe显示。用run_till_terminate()代表终止。安装好之后,打开jupyter notebook。也可以指定运行时间,并获取最后一天的参数。首先还是打开之前建好的gee虚拟环境。

所有专家都曾始于新手 682

android intent过滤器,Android Intent过滤器:您如何正确使用Intent.CATEGORY_BROWSABLE?

我有一个意图过滤器来拦截我的域上的浏览器的网址。这将使用户可以选择使用本机应用程序或浏览器。我已经设置了以下意图过滤器。Android Intent过滤器:您如何正确使用Intent.CATEGORY_BROWSABLE?现在,我不打算将用户陷入本机应用程序中,因为使用浏览器有很多好处。所以我想让用户能够返回应用程序中的浏览器。我创建了一个带有onClick的按钮,它只是创建一个View的意图和代...

weixin_39842682的博客 385

【FPGA教程案例55】深度学习案例2——基于FPGA的CNN卷积神经网络之ReLu激活层verilog实现

在本课程中,我们将对CNN的ReLu函数模块的FPGA实现做详细的介绍和学习。从仿真结果可知,通过Rule激活函数之后,小于的输入数据输出为0,否则输出是输入本身。,我们对CNN的基本原理有了初步认识。ReLu函数具备如下优缺点。按照课程1相似的操作方式。

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

ARM 之十六 详解 CMSIS 版本变迁、各组件使用示例

目前,CMSIS 已经发展到了第六版,其目录结构也发生了重大的变化。在不断发展中,很多原来 CMSIS 的组件被不断独立出去,并因此成立了很多开源社区,今天就来学习一下!由于 CMSIS 已经包含了相当丰富的文档,因此,本文重点学习版本之间的变化以及一些实际使用示例。

技术干货 1961

Intent中putExtra()方法用法

有3个Activity 分别是A,B,C A里面Intent 首先 putExtra("1","1");putExtra("2","2");setclass(A.this,B.class); B里面Intent 首先 putExtra("3","3");setclass(B.this,C.class); C里面的Intent 能收到这3个键值吗? 从A-->B 新建一个intent

Palmer_xu的专栏 5万+

[Dify实战] 合同审阅助手:识别风险条款、生成修改建议-带绑定资源

摘要: Dify合同审阅助手通过AI技术提升合同审阅效率,快速识别风险条款并输出结构化修改建议。方案包括合同输入、关键条款识别、风险评级和报告生成流程,重点关注付款、责任限制等核心条款。采用分层风险分级(高/中/低)和"红线清单"机制,确保审阅标准化。实施建议先建立条款库和模板,通过样本测试优化模型,定期更新规则库。该方案可缩短审阅时间50%以上,提高风险识别准确率,最终实现法务经验的可复用沉淀。

技术小甜甜:传播可落地技术,帮助个人和企业降低解决真实场景问题的成本 609

**android Intent 的Componet ,Action ,Category,Data,Type,Extra,Flag 7种属性详解**

android Intent 的Componet ,Action ,Category,Data,Type,Extra,Flag 7种属性详解 一、Componet : 用于指出启动的组件(实现页面的跳转) Componet Name(String pkg,String cls) Componet Name(Context pkg,String cls) Componet Name

小男孩儿 358

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

jre9下载 jdk9

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

putextra 传递对象_intent.putextra用法 使用Intent传递对象的两种方式 - 电脑常识 - 服务器之家...

intent.putextra用法 使用Intent传递对象的两种方式发布时间:2017-05-22来源:服务器之家Intent 的用法相信你已经比较熟悉了,我们可以借助它来启动活动、发送广播、启动服务等。在进行上述操作的时候,我们还可以在Intent 中添加一些附加数据,以达到传值的效果,比如在FirstActivity 中添加如下代码:Intent intent = new Intent(Fi...

weixin_39886547的博客 4597

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

intent.putExtra()方法参数详解

【putExtra("A",B)中,AB为键值对,第一个参数为键名,第二个参数为键对应的值。顺便提一下,如果想取出Intent对象中的这些值,需要在你的另一个Activity中用getXXXXXExt

wangchaoqi1985的博客 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")

android component包含的内容

activity 在Android apk里面activity是一个UI的概念,一个应用程序可以拥有多个Activity。实际上一个Activity就是一个窗口,而里面的内容就是各种view了。通过setContentView()将窗口和内容联系在一起。 service service实际上可以就看成没有UI而运行在后台的component,在Android中这个service又分

lixujunk的专栏 995

Android WebView学习

1、关于WebView的使用: ****与JS交互**** 拨打电话、发送短信、发送邮件 上传图片(版本兼容) 进度条设置 字体大小设置 返回网页上一层、显示网页标题 全屏播放网络视频 首页 2、文章说明 WebView的使用已经是老生常谈了,看到很多文章说了用法,但我很少看到全的或者是项目中可以直接使用的,都是看了很多后,自己把功能都集合在一起。这里是一份比较全面的W...

YuannaY的博客 593

从0开始认识android(四):Intent及intent-filtter详解

该系列的文章只是本人的一些个人理解、随笔、总结,也深怕误人子弟,如果理解有错的地方还希望看到的朋友指正,不胜感激!!!

jack_bear_csdn的博客 849

Android Intents

Android Intents Issue #11 Android, April 2014 By Martin Marconcini Introduction Perhaps a very distinctive thing about Android is the ability for applications to launch other apps or easily

Battling against our own ignorance 1940

Android在app中启动浏览器/打电话/发短信等东西

Intent intent = new Intent(); intent.setAction("android.intent.action.VIEW"); Uri content_url = Uri.parse(updateUrl); intent.setData(content_url); startActivity(intent); 然后还需要在Manifest中找到对应的Acti

一名小安卓的博客 759

Android:android.intent.category 定义

定义的种类与版本相关,这里列出 android 4.1的定义 : F:\Android\sdk\platforms\android-16\data\categories.txt [html] view plaincopyprint? android.intent.category.ALTERNATIVE #  android.intent.category.APP_B

雁峰 2625

解决cat=[android.intent.category.BROWSABLE] dat=http://url typ=text/html

异常出现在注释掉的intent那一行 修改方法就是把: intent.setDataAndType(Uri.parse(versionInfo.getUrl()), “text/html”); 改成: intent.setData(Uri.parse(versionInfo.getUrl()));因为没activity能检测到”text/html”这个type,所以就报错了。 例如手机上没

秦时明月 2394

Intent的七大属性, ComponentName、  Action 、 Category 、 Data  、Type、  Extra  、Flags。

目录 Intent的七大属性: ComponentName、 Action 、 Category 、 Data 、Type、 Extra 、Flags。 (一)、ComponentName属性: (二)、Action、Category属性与intent-filter配置: (三)、Category 属性: (四)、Data属性: (五)、Type属性: (六)、Extra属性: 4、 Intent利用Action属性中的ACTION_GET_CONTENT获取返...

ZhangJiqun&191cm&85kg 4046
下一篇: toast 因 activity 的样式设置而变化
这种感觉很秋天
博客等级 码龄12年 16粉丝 32原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值