Android Studio清单开始和结束标记

时间:2017-04-03 04:15:03

标签: java android manifest

我刚刚开始编程,遇到了问题。我的代码似乎很好,但Android Studio将不同的开始标记与结束标记匹配。这是我的代码:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="330" android:versionName="3.3 beta" package="com.example.furmanthelegend.nocrastinationapp">
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="25" />
<uses-permission android:name="android.permission.GET_TASKS" android:maxSdkVersion="24" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-feature android:name="android.hardware.sensor.stepcounter" android:required="false" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<application android:theme="null" android:label="NoCrastination" android:icon="res/drawable-mdpi-v4/ic_launcher.png" android:name="de.dfki.nocrastination.utils.NoCrastinationApplication" android:allowBackup="true">
    <activity android:label="NoCrastination" android:name="de.dfki.nocrastination.ui.activities.MainActivity" android:excludeFromRecents="true">
        <intent-filler>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filler>
    </activity>
    <activity android:label="Add New Condition" android:name="de.dfki.nocrastination.ui.activities.AddConditionsActivity" android:excludeFromRecents="true" />
    <activity android:label="Condition" android:name="de.dfki.nocrastination.ui.activities.ConditionDetailActivity" android:excludeFromRecents="true" />
    <activity android:label="App Information" android:name="de.dfki.nocrastination.ui.activities.appinformationActivity" android:excludeFromRecents="true" />
    <activity android:label="Recently Used Apps" android:name="de.dfki.nocrastination.ui.activities.previousappsActivity" android:excludeFromRecents="true" />
    <activity android:label="Credits" android:name="de.dfki.nocrastination.ui.activities.creditsActivity" android:excludeFromRecents="true" />
    <activity android:label="Settings" android:name="de.dfki.nocrastination.ui.activities.settingsactivity" android:excludeFromRecents="true" />
    <activity android:name="org.wordpress.passcodelock.PasscodeUnlockActivity" android:windowSoftInputMode="stateHidden" />
    <activity android:name="org.wordpress.passcodelock.PasscodeManagePasswordActivity" android:windowSoftInputMode="stateHidden" />
    <service android:name="de.dfki.nocrastination.logging.BackgroundService" android:enabled="true" android:exported="false" />
    <reciever android:name="de.dfki.nocrastination.logging.BootCompleteReceiver" android:enabled="true" android:exported="false" />
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED" />
        </intent-filter>
    </reciever>
    <provider android:label="NoCrastination" android:name="de.dfki.nocrastination.data.NoCrastinationProvider" android:exported="false" android:authorities="de.dfki.appdetox" />
    <service android:label="NoCrastination Laws" android:icon="res/drawable-xhdpi-v4/dcw_ic_extension.png" android:name="de.dfki.nocrastination.dashclockextension.nocrastinationExtension" android:permission="com.google.android.appa.dashclock.premission.READ_EXTENSION_DATA">
       <intent-filler>
           <action android:name="com.google.android.apps.dashclock.Extension" />
       </intent-filler>
        <meta-data android:name="protocolVersion" android:value="1" />
        <meta-data android:name="description" android:value="Shows current amount of active conditions and condition breaks" />
    </service>
    <service android:label="NoCrastination" android:name="de.dfki.nocrastination.logging.AppUsageAccesibilityService" android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE" android:enabled="true" >
        <intent-filter>
            <action android:name="android.accessibilityservice.AccessibilityService" />
        </intent-filter>
        <meta-data android:name="android.accessibilityservice" android:resource="res/xml/accessibility_service_config.xml" />
    </service>
    <meta-data android:name="com.crashlytics.ApiKey" android:value="c5cac52287e9abe392fe06e567285ee4aa9ed0bb" />
    <receiver android:label="NoCrastination&apos;s device admin" android:name="de.dfki.nocrastination.ui.activities.DeviceAdminSample" android:permission="android.permission.BING_DEVICE_ADMIN" android:description="Prevent stop forcefully">
            <meta-data android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
            <intent-filler>
                    <action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
            </intent-filler>
    </receiver>
  </application>
<manifest>

我不擅长编程,所以任何提示都会非常感激和乐于助人。主要问题是android studio匹配和其他类似的情况。

1 个答案:

答案 0 :(得分:0)

你使用内联关闭标记和大纲也只是从接收者标记中删除(/):

<reciever android:name="de.dfki.nocrastination.logging.BootCompleteReceiver" android:enabled="true" android:exported="false"> ==> removed "/"
    <intent-filter>
        <action android:name="android.intent.action.BOOT_COMPLETED" />
    </intent-filter>
</reciever>

并添加&#34; /&#34;到最后一行