热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

android开发——学习总结20131204

android:launchMode,即Activity的启动模式,与Intent中的Flags共同作用,决定Activity如何启动。a

android:launchMode,即Activity的启动模式,与Intent中的Flags共同作用,决定Activity如何启动。

android:launchMode分别有"standard", "singleTop", "singleTask", "singleInstance".

"standard": 每次都创建新的实例;

"singleTop": 如果目标Task的顶端是就是对应的实例,那么这个实例将会接受新的Intent;否则,创建新的实例;

"singleTask": 同一个Task中只允许存在一个实例,而且这个实例必须在该Task的Activity堆栈的低端,允许其他Activity实例存在;

"singleInstance": 同一个Task中只允许存在一个实例,而且不允许其他Activity实例存在。

 

android:configChanges

当一些配置发生改变时,Activity将会关闭,然后重启,但是配置了这个选项,可以捕获配置改变的事件,从而避免Activity重启。

可捕获的事件如:

ValueDescription
"mcc"The IMSI mobile country code (MCC) has changed — a SIM has been detected and updated the MCC. 系统监测到SIM卡之后,会更新MCC。
"mnc"The IMSI mobile network code (MNC) has changed — a SIM has been detected and updated the MNC. 系统监测到SIM卡之后,会更新MNC。
"locale"The locale has changed — the user has selected a new language that text should be displayed in. 用户更改系统语言。
"touchscreen"The touchscreen has changed. (This should never normally happen.) 
"keyboard"The keyboard type has changed — for example, the user has plugged in an external keyboard. 键盘发生改变,如用户插入外接键盘。
"keyboardHidden"The keyboard accessibility has changed — for example, the user has revealed the hardware keyboard. 键盘可见性改变。
"navigation"The navigation type (trackball/dpad) has changed. (This should never normally happen.)
"screenLayout"The screen layout has changed — this might be caused by a different display being activated. 屏幕布局发生变化,如其他不同的显示器打开了。
"fontScale"The font scaling factor has changed — the user has selected a new global font size. 用户修改了系统全局字体大小。
"uiMode"The user interface mode has changed — this can be caused when the user places the device into a desk/car dock or when the night mode changes. See UiModeManagerAdded in API level 8. 系统uiMode发生改变,如进入夜视模式。
"orientation"The screen orientation has changed — the user has rotated the device. 屏幕方向改变了,如旋转屏幕。

Note: If your application targets API level 13 or higher (as declared by the minSdkVersion and targetSdkVersion attributes), then you should also declare the "screenSize" configuration, because it also changes when a device switches between portrait and landscape orientations. 当你的应用目标API Level大于等于13时,应该同时声明screenSize配置,因为screenSize在切换横/纵向时改变的。

"screenSize"The current available screen size has changed. This represents a change in the currently available size, relative to the current aspect ratio, so will change when the user switches between landscape and portrait. However, if your application targets API level 12 or lower, then your activity always handles this configuration change itself (this configuration change does not restart your activity, even when running on an Android 3.2 or higher device). 当前可用屏幕大小发生改变(用户在切换屏幕横/纵向时)。

Added in API level 13.

"smallestScreenSize"The physical screen size has changed. This represents a change in size regardless of orientation, so will only change when the actual physical screen size has changed such as switching to an external display. A change to this configuration corresponds to a change in the smallestWidth configuration. However, if your application targets API level 12 or lower, then your activity always handles this configuration change itself (this configuration change does not restart your activity, even when running on an Android 3.2 or higher device). 物理屏幕发生改变时(连接外部显示器)

Added in API level 13.

"layoutDirection"The layout direction has changed. For example, changing from left-to-right (LTR) to right-to-left (RTL). Added in API level 17.布局方向发生改变。

转:https://www.cnblogs.com/sunnyfarmer/p/3458468.html



推荐阅读
  • 本文讨论了一个关于cuowu类的问题,作者在使用cuowu类时遇到了错误提示和使用AdjustmentListener的问题。文章提供了16个解决方案,并给出了两个可能导致错误的原因。 ... [详细]
  • 本文介绍了Web学习历程记录中关于Tomcat的基本概念和配置。首先解释了Web静态Web资源和动态Web资源的概念,以及C/S架构和B/S架构的区别。然后介绍了常见的Web服务器,包括Weblogic、WebSphere和Tomcat。接着详细讲解了Tomcat的虚拟主机、web应用和虚拟路径映射的概念和配置过程。最后简要介绍了http协议的作用。本文内容详实,适合初学者了解Tomcat的基础知识。 ... [详细]
  • CF:3D City Model(小思维)问题解析和代码实现
    本文通过解析CF:3D City Model问题,介绍了问题的背景和要求,并给出了相应的代码实现。该问题涉及到在一个矩形的网格上建造城市的情景,每个网格单元可以作为建筑的基础,建筑由多个立方体叠加而成。文章详细讲解了问题的解决思路,并给出了相应的代码实现供读者参考。 ... [详细]
  • 本文介绍了一款名为TimeSelector的Android日期时间选择器,采用了Material Design风格,可以在Android Studio中通过gradle添加依赖来使用,也可以在Eclipse中下载源码使用。文章详细介绍了TimeSelector的构造方法和参数说明,以及如何使用回调函数来处理选取时间后的操作。同时还提供了示例代码和可选的起始时间和结束时间设置。 ... [详细]
  • Activiti7流程定义开发笔记
    本文介绍了Activiti7流程定义的开发笔记,包括流程定义的概念、使用activiti-explorer和activiti-eclipse-designer进行建模的方式,以及生成流程图的方法。还介绍了流程定义部署的概念和步骤,包括将bpmn和png文件添加部署到activiti数据库中的方法,以及使用ZIP包进行部署的方式。同时还提到了activiti.cfg.xml文件的作用。 ... [详细]
  • Iamtryingtocreateanarrayofstructinstanceslikethis:我试图创建一个这样的struct实例数组:letinstallers: ... [详细]
  • Sleuth+zipkin链路追踪SpringCloud微服务的解决方案
    在庞大的微服务群中,随着业务扩展,微服务个数增多,系统调用链路复杂化。Sleuth+zipkin是解决SpringCloud微服务定位和追踪的方案。通过TraceId将不同服务调用的日志串联起来,实现请求链路跟踪。通过Feign调用和Request传递TraceId,将整个调用链路的服务日志归组合并,提供定位和追踪的功能。 ... [详细]
  • 1简介本文结合数字信号处理课程和Matlab程序设计课程的相关知识,给出了基于Matlab的音乐播放器的总体设计方案,介绍了播放器主要模块的功能,设计与实现方法.我们将该设 ... [详细]
  • 今天就跟大家聊聊有关怎么在Android应用中实现一个换肤功能,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根 ... [详细]
  • GetWindowLong函数
    今天在看一个代码里头写了GetWindowLong(hwnd,0),我当时就有点费解,靠,上网搜索函数原型说明,死活找不到第 ... [详细]
  • 本文介绍了Android 7的学习笔记总结,包括最新的移动架构视频、大厂安卓面试真题和项目实战源码讲义。同时还分享了开源的完整内容,并提醒读者在使用FileProvider适配时要注意不同模块的AndroidManfiest.xml中配置的xml文件名必须不同,否则会出现问题。 ... [详细]
  • 微信小程序导航跟随的实现方法
    本文介绍了在微信小程序中实现导航跟随的方法。通过设置导航的position属性和绑定滚动事件,可以实现页面向下滚动到导航位置时,导航固定在页面最上方;页面向上滚动到导航位置时,导航恢复到原始位置;点击导航可以平滑跳转到相应位置。代码示例也给出了具体实现方法。 ... [详细]
  • Java图形化计算器设计与实现
    本文介绍了使用Java编程语言设计和实现图形化计算器的方法。通过使用swing包和awt包中的组件,作者创建了一个具有按钮监听器和自定义界面尺寸和布局的计算器。文章还分享了在图形化界面设计中的一些心得体会。 ... [详细]
  • 本文介绍了一个Magento模块,其主要功能是实现前台用户利用表单给管理员发送邮件。通过阅读该模块的代码,可以了解到一些有关Magento的细节,例如如何获取系统标签id、如何使用Magento默认的提示信息以及如何使用smtp服务等。文章还提到了安装SMTP Pro插件的方法,并给出了前台页面的代码示例。 ... [详细]
  • 详解Android  自定义UI模板设计_由浅入深
    学习安卓已有一些日子,前段时间整理了不少笔记,但是发现笔记不变分享与携带。今天开始整理博客,全当是与大家分享交流与自身学习理解的过程吧。结合最近在做的一个新闻类app及学习中的问题,一点一点整理一下, ... [详细]
author-avatar
挖墙找红杏000
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有