- 浏览: 138388 次
- 性别:
- 来自: 北京
-
文章分类
最新评论
-
bi_bao:
lz好啊 我也在做彩信的备份还原工作.您的附件还原代码很有用, ...
彩信 -
suifeng0211:
如果想不调用系统彩信界面,直接从后台发送,就比较麻烦了。但确定 ...
彩信发送。 -
atmus:
横竖看不懂
彩信发送。 -
smartdongdong:
这么好的帖子才看到!
MMS/SMS 入口 , -
A_L_85:
在LauncherModel中final Cursor c = ...
Android2.1_Launcher2学习笔记
activity 属性:
http://developer.android.com/guide/topics/manifest/activity-element.html
免翻**墙搬运:
<activity>
<activity android:allowTaskReparenting=["true" | "false"] android:alwaysRetainTaskState=["true" | "false"] android:clearTaskOnLaunch=["true" | "false"] android:configChanges=["mcc", "mnc", "locale", "touchscreen", "keyboard", "keyboardHidden", "navigation", "orientation", "screenLayout", "fontScale", "uiMode"] android:enabled=["true" | "false"] android:excludeFromRecents=["true" | "false"] android:exported=["true" | "false"] android:finishOnTaskLaunch=["true" | "false"] android:icon="drawable resource" android:label="string resource" android:launchMode=["multiple" | "singleTop" | "singleTask" | "singleInstance"] android:multiprocess=["true" | "false"] android:name="string" android:noHistory=["true" | "false"] android:permission="string" android:process="string" android:screenOrientation=["unspecified" | "user" | "behind" | "landscape" | "portrait" | "sensor" | "nosensor"] android:stateNotNeeded=["true" | "false"] android:taskAffinity="string" android:theme="resource or theme" android:windowSoftInputMode=["stateUnspecified", "stateUnchanged", "stateHidden", "stateAlwaysHidden", "stateVisible", "stateAlwaysVisible", "adjustUnspecified", "adjustResize", "adjustPan"] > . . . </activity>
<application>
<intent-filter>
<meta-data>
Activity
subclass) that implements part of the application's visual user interface. All activities must be represented by <activity>
elements in the manifest file. Any that are not declared there will not be seen by the system and will never be run.android:allowTaskReparenting
true
" if it can move, and "false
" if it must remain with the task where it started.
If this attribute is not set, the value set by the corresponding allowTaskReparenting
attribute of the <application>
element applies to the activity. The default value is "false
".
Normally when an activity is started, it's associated with the task of the activity that started it and it stays there for its entire lifetime. You can use this attribute to force it to be re-parented to the task it has an affinity for when its current task is no longer displayed. Typically, it's used to cause the activities of an application to move to the main task associated with that application.
For example, if an e-mail message contains a link to a web page, clicking the link brings up an activity that can display the page. That activity is defined by the browser application, but is launched as part of the e-mail task. If it's reparented to the browser task, it will be shown when the browser next comes to the front, and will be absent when the e-mail task again comes forward.
The affinity of an activity is defined by the taskAffinity
attribute. The affinity of a task is determined by reading the affinity of its root activity. Therefore, by definition, a root activity is always in a task with the same affinity. Since activities with "singleTask
" or "singleInstance
" launch modes can only be at the root of a task, re-parenting is limited to the "standard
" and "singleTop
" modes. (See also the launchMode
attribute.)
android:alwaysRetainTaskState
true
" if it will be, and "false
" if the system is allowed to reset the task to its initial state in certain situations. The default value is "false
". This attribute is meaningful only for the root activity of a task; it's ignored for all other activities.
Normally, the system clears a task (removes all activities from the stack above the root activity) in certain situations when the user re-selects that task from the home screen. Typically, this is done if the user hasn't visited the task for a certain amount of time, such as 30 minutes.
However, when this attribute is "true
", users will always return to the task in its last state, regardless of how they get there. This is useful, for example, in an application like the web browser where there is a lot of state (such as multiple open tabs) that users would not like to lose.
android:clearTaskOnLaunch
true
" if the task is always stripped down to its root activity, and "false
" if not. The default value is "false
". This attribute is meaningful only for activities that start a new task (the root activity); it's ignored for all other activities in the task.
When the value is "true
", every time users start the task again, they are brought to its root activity, regardless of what they were last doing in the task and regardless of whether they used BACK or HOME to last leave it. When the value is "false
", the task may be cleared of activities in some situations (see the alwaysRetainTaskState
attribute), but not always.
Suppose, for example, that someone launches activity P from the home screen, and from there goes to activity Q. The user next presses HOME, and then returns to activity P. Normally, the user would see activity Q, since that is what they were last doing in P's task. However, if P set this flag to "true
", all of the activities on top of it (Q in this case) were removed when the user pressed HOME and the task went to the background. So the user sees only P when returning to the task.
If this attribute and allowTaskReparenting
are both "true
", any activities that can be re-parented are moved to the task they share an affinity with; the remaining activities are then dropped, as described above.
android:configChanges
onConfigurationChanged()
method is called.
Note: Using this attribute should be avoided and used only as a last-resort. Please read Handling Runtime Changes for more information about how to properly handle a restart due to a configuration change.
Any or all of the following strings are valid values for this attribute. Multiple values are separated by '|
' — for example, "locale|navigation|orientation
".
"mcc " |
The IMSI mobile country code (MCC) has changed — a SIM has been detected and updated the MCC. |
"mnc " |
The IMSI mobile network code (MNC) has changed — a SIM has been detected and updated the 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.) |
"orientation " |
The screen orientation has changed — the user has rotated the device. |
"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 the night mode changes. See UiModeManager . Introduced in API Level 8. |
All of these configuration changes can impact the resource values seen by the application. Therefore, when
is called, it will generally be necessary to again retrieve all resources (including view layouts, drawables, and so on) to correctly handle the change.onConfigurationChanged()
android:enabled
true
" if it can be, and "false
" if not. The default value is "true
".
The <application>
element has its own enabled
attribute that applies to all application components, including activities. The <application>
and <activity>
attributes must both be "true
" (as they both are by default) for the system to be able to instantiate the activity. If either is "false
", it cannot be instantiated.
android:excludeFromRecents
true
" if it should be excluded, and "false
" if it should be included. The default value is "false
".
android:exported
true
" if it can be, and "false
" if not. If "false
", the activity can be launched only by components of the same application or applications with the same user ID.
The default value depends on whether the activity contains intent filters. The absence of any filters means that the activity can be invoked only by specifying its exact class name. This implies that the activity is intended only for application-internal use (since others would not know the class name). So in this case, the default value is "false
". On the other hand, the presence of at least one filter implies that the activity is intended for external use, so the default value is "true
".
This attribute is not the only way to limit an activity's exposure to other applications. You can also use a permission to limit the external entities that can invoke the activity (see the permission
attribute).
android:finishOnTaskLaunch
true
" if it should be shut down, and "false
" if not. The default value is "false
".
If this attribute and allowTaskReparenting
are both "true
", this attribute trumps the other. The affinity of the activity is ignored. The activity is not re-parented, but destroyed.
android:icon
label
attribute).
This attribute must be set as a reference to a drawable resource containing the image definition. If it is not set, the icon specified for the application as a whole is used instead (see the <application>
element's icon
attribute).
The activity's icon — whether set here or by the <application>
element — is also the default icon for all the activity's intent filters (see the <intent-filter>
element's icon
attribute).
android:label
If this attribute is not set, the label set for the application as a whole is used instead (see the <application>
element's label
attribute).
The activity's label — whether set here or by the <application>
element — is also the default label for all the activity's intent filters (see the <intent-filter>
element's label
attribute).
The label should be set as a reference to a string resource, so that it can be localized like other strings in the user interface. However, as a convenience while you're developing the application, it can also be set as a raw string.
android:launchMode
FLAG_ACTIVITY_*
constants) in Intent
objects to determine what should happen when the activity is called upon to handle an intent. They are:
"standard
"
"singleTop
"
"singleTask
"
"singleInstance
"
The default mode is "standard
".
As shown in the table below, the modes fall into two main groups, with "standard
" and "singleTop
" activities on one side, and "singleTask
" and "singleInstance
" activities on the other. An activity with the "standard
" or "singleTop
" launch mode can be instantiated multiple times. The instances can belong to any task and can be located anywhere in the activity stack. Typically, they're launched into the task that called
(unless the Intent object contains a startActivity()
instruction, in which case a different task is chosen — see the taskAffinity attribute).FLAG_ACTIVITY_NEW_TASK
In contrast, "singleTask
" and "singleInstance
" activities can only begin a task. They are always at the root of the activity stack. Moreover, the device can hold only one instance of the activity at a time — only one such task.
The "standard
" and "singleTop
" modes differ from each other in just one respect: Every time there's a new intent for a "standard
" activity, a new instance of the class is created to respond to that intent. Each instance handles a single intent. Similarly, a new instance of a "singleTop
" activity may also be created to handle a new intent. However, if the target task already has an existing instance of the activity at the top of its stack, that instance will receive the new intent (in an
call); a new instance is not created. In other circumstances — for example, if an existing instance of the "onNewIntent()
singleTop
" activity is in the target task, but not at the top of the stack, or if it's at the top of a stack, but not in the target task — a new instance would be created and pushed on the stack.
The "singleTask
" and "singleInstance
" modes also differ from each other in only one respect: A "singleTask
" activity allows other activities to be part of its task. It's always at the root of its task, but other activities (necessarily "standard
" and "singleTop
" activities) can be launched into that task. A "singleInstance
" activity, on the other hand, permits no other activities to be part of its task. It's the only activity in the task. If it starts another activity, that activity is assigned to a different task — as ifFLAG_ACTIVITY_NEW_TASK
was in the intent.
Normal launches for most activities | "standard " |
Yes | Default. The system always creates a new instance of the activity in the target task and routes the intent to it. |
"singleTop " |
Conditionally | If an instance of the activity already exists at the top of the target task, the system routes the intent to that instance through a call to its onNewIntent() method, rather than creating a new instance of the activity. |
|
Specialized launches (not recommended for general use) |
"singleTask " |
No | The system creates the activity at the root of a new task and routes the intent to it. However, if an instance of the activity already exists, the system routes the intent to existing instance through a call to its onNewIntent() method, rather than creating a new one. |
"singleInstance " |
No | Same as "singleTask" , except that the system doesn't launch any other activities into the task holding the instance. The activity is always the single and only member of its task. |
As shown in the table above, standard
is the default mode and is appropriate for most types of activities. SingleTop
is also a common and useful launch mode for many types of activities. The other modes — singleTask
and singleInstance
— are not appropriate for most applications, since they result in an interaction model that is likely to be unfamiliar to users and is very different from most other applications.
Regardless of the launch mode that you choose, make sure to test the usability of the activity during launch and when navigating back to it from other activities and tasks using the BACK key.
For more information on launch modes and their interaction with Intent flags, see the Activities and Tasks section of the Application Fundamentals document.
这些属性被用来处理每个应用启动和相互调用以及
相关推荐
ubuntu-22.04-preinstalled-server-arm64+raspi.img.xz http://cdimages.ubuntu.com/ubuntu/releases/22.04/release/
使用 `inline-manifest-webpack-plugin` 非常简单,首先需要安装这个插件,可以通过npm或者yarn来完成: ```bash npm install --save-dev inline-manifest-webpack-plugin # 或者 yarn add --dev inline-manifest-...
清单摘要 阅读Kubernetes清单并打印其内容表。 安装 $ go get github.com/bryanl/manifest-summary ...+-------------+-----------------------+-----------------+ | API VERSION | KIND | NAME | +---
manifest-tool, 清单列表对象创建/查询的清单工具 清单工具manifest-tool 是一个 命令行 实用工具,它实现 Docker 注册表 v2.2 API的一部分,用于与注册表中的清单对象相互作用。这个工具主要是为了查看。创建和推动...
webpack-manifest-plugin, 用于生成资产清单的web pack插件 web pack清单插件 web pack插件用于生成资产清单。注:以下是有关 webpack-manifest-plugin的下一个主要版本,请检查 ...
结合"manifest-merger-22.1.1.zip",我们可以思考在不同场景下解决依赖冲突的策略,这对于任何软件开发者来说都是一笔宝贵的财富。希望这篇文章能帮助你开启Bukkit插件开发的旅程,探索更多可能。
webpack-manifest-plugin是一个 模块。 此模块需要节点版本(v10.0.0 +)和Webpack v4.44.0 +。 安装 使用npm: npm install webpack-nano webpack-manifest-plugin --save-dev 注意:我们建议使用 ,这是一个...
离线安装包,亲测可用
java -jar target/manifest-merger-jar-with-dependencies.jar --main mainAndroidManifest.xml --log [VERBOSE, INFO, WARNING, ERROR] --libs [path separated list of lib's manifests] --overlays [path ...
"web-app-manifest-loader" 是一个专门针对Web应用程序清单(Web App Manifest)处理的前端开源库。本文将深入探讨这个库的核心功能、用途以及它如何融入Web开发流程。 Web应用程序清单(Web App Manifest)是一种...
html5-manifest-webpack-plugin 一个Webpack插件,用于生成Html5清单Appcache文件。 安装 使用npm: npm install html5-manifest-webpack-plugin --save-dev 用法 使您的webpack.config.js文件如下所示: const ...
manifest-tool是一个命令行实用程序,用于实现Docker注册表v2.2 API的客户端的一部分,用于与符合该规范的注册表中的清单对象进行交互。 创建此工具主要是为了查看,创建和推送Docker注册表中的新清单清单对象类型...
maven-manifest-plugin-1.0.0-sources.jar
webpack-web-app-manifest-plugin webpack-web-app-manifest-plugin是一个Webpack插件,可生成PWA清单并与生成的资产JSON集成。如何安装npm install --save-dev webpack-web-app-manifest-plugin 或者yarn add ...
fetch-manifest-json 从PWA获取mainfest.json。 安装 $ npm install --save fetch-manifest-json 用法 const fetchManifestJson = require ( 'fetch-manifest-json' ) ; fetchManifestJson ( < URL> ).then(console...
maven-manifest-plugin-1.0.1.jar
maven-manifest-plugin-1.0.0.jar
Red_Hat_Enterprise_Linux-7-Package_Manifest-en-US
总的来说,`manifest-explorer`是开发过程中一个实用的辅助工具,它让管理工作区的`manifest`文件变得更加简单和高效。通过深入了解并利用这个工具,开发者可以更好地管理和优化他们的应用程序,确保其在各种环境下...
"mendel-manifest-uglify"这个主题涉及到的是一个前端开源库的特定部分,主要关注如何处理Mendel项目的清单(manifest)文件,并应用uglifyjs进行源代码优化。 Mendel是一个前端构建工具,它致力于解决模块化应用中...