android - android :name mean? 中的前导点是什么

标签 android android-manifest

这两种设置android:name字段的方式有什么区别?

我看到了这两种类型,但不确定为什么要用这两种不同的方式编写

我经常看到的一种方式是(注意“和服务器”之间的“.”):

  android:name=".Server" 

没有额外“.”的另一种方式名字前:

 android:name="Server"

示例 xml

  <service
        android:name=".Server"
        android:icon="@drawable/ic_launcher"
        android:label="audioservice"
        android:process=":my_process" >
    </service>

     <activity android:name=".DBView"> 
        <intent-filter >
            <action android:name="com.example.test.DBVIEW"/>
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>

最佳答案

this .

The name of the Service subclass that implements the service. This should be a fully qualified class name (such as, "com.example.project.RoomService"). However, as a shorthand, if the first character of the name is a period (for example, ".RoomService"), it is appended to the package name specified in the element.

关于android - android :name mean? 中的前导点是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14682382/

相关文章:

android - 如何使 APK 符合 Google Play 64 位要求?

android - 在 Android 上解析 DNS SRV 记录的轻量级方法

java - 如何过滤 Google Play,使应用仅显示在 7 英寸平板电脑上

java - 如何在静音模式下创建 Android 事件警报?

reactjs - React Native AndroidManifest.xml 调试与主?

java - 如何在 Android Studio 中使用谷歌云翻译 API?

android - 谷歌分析 w/Android : Programmatically set ga_reportUncaughtExceptions?

java - 安卓提醒 Intent

android - 如何注册我的 Android 应用程序以打开我的自定义文件扩展名,而不是所有文件

android图片库开始移动或减速并停止移动