Loading [Contrib]/a11y/accessibility-menu.js

alex_bn_lee

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

【069】Android 中的 Manifest.xml

AndroidManifest.xml


下面内容参考:Beginning Android 4 Application Development Page31.


1. <application>

  第一梯队, 在最外面.

contained in:
<manifest>
can contain:
<activity>
<activity-alias>
<service>
<receiver>
<provider>
<uses-library>

2. <activity>

  第二梯队, 在 <application> 内部.

contained in:
<application>
can contain:
<intent-filter>
<meta-data>

activity - theme:

<activity android:theme="@android:style/Theme.Dialog">    //对话框形式
<activity android:theme="@android:style/Theme.Translucent">  //透明形式

activity - screenOrientation:

<android:screenOrientation="landscape">  //强制水平显示
<android:screenOrientation="portrait">  //强制竖直显示

包括以下值:"unspecified" | "user" | "behind" | "landscape" | "portrait" | "reverseLandscape" | "reversePortrait" | "sensorLandscape" | "sensorPortrait" | "sensor" | "fullSensor" | "nosensor".

activity - windowSoftInputMode:

<android:windowSoftInputMode="stateHidden">  //即使默认文本框获取焦点, 但是不会立即弹出输入法面板

包括以下值:"stateUnspecified", "stateUnchanged", "stateHidden", "stateAlwaysHidden", "stateVisible", "stateAlwaysVisible", "adjustUnspecified", "adjustResize", "adjustPan".


3. <intent-filter>

  第三梯队, 在 <activity> 内部.

contained in:
<activity>
<activity-alias>
<service>
<receiver>
must contain:
<action>
can contain:
<category>
<data>

4. <action>

  第四阶梯, 在 <intent-filter> 内部.

contained in:
<intent-filter>
android:name:改值可以在 intent 的构造函数中使用.
<actionandroid:name="com.example.project.TRANSMOGRIFY"/>

 


5. <category>

  第四阶梯, 在 <intent-filter> 内部.

contained in:
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />

举个例子:

<activity
  android:label=” Second Activity”
  android:name=”.SecondActivity” >
  <intent-filter >
    <action android:name=”net.learn2develop.SecondActivity” />
    <category android:name=”android.intent.category.DEFAULT” />
  </intent-filter>
</activity>

  The category for the intent filter is android.intent.category.DEFAULT. You need to add this to
the intent filter so that this activity can be started by another activity using the startActivity()
method (more on this shortly).

public void onClick(View view) {
  startActivity(new Intent(“net.learn2develop.SecondActivity”));
}

 


6. <uses-permission>

  第一阶梯, 用来提供许可的, 只有提供了许可才可以使用手机的一些功能.

contained in:
<manifest>

举个例子:

<uses-permission android:name="android.permission.CALL_PHONE"/>  //打电话
<uses-permission android:name="android.permission.SEND_SMS"/>  //发短信
<uses-permission android:name="android.permission.INTERNET"/>  //上网
<uses-permission android:name="android.permission.VIBRATE"/>  //通知

常量值属于 Manifest.permission 类.

 

 

 

 

 

 

 

 

 

 

 

android.intent.category

posted on   McDelfino  阅读(277)  评论(0编辑  收藏  举报

编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· .NET10 - 预览版1新功能体验(一)
点击右上角即可分享
微信分享提示