当前位置: 代码迷 >> Android >> Android:这里现在允许元素活动
  详细解决方案

Android:这里现在允许元素活动

热度:1   发布时间:2023-08-04 10:11:15.0

在下面的代码中,Android Studio 向我展示了

“这里现在允许元素活动”

当我将鼠标悬停在活动标签上,并且应用程序没有启动默认的活动时,我尝试清理项目,重建项目然后重新启动 Android Studio,我尝试使现金无效/重启,但问题仍然存在,如何解决这个?

    <activit
        android:name=".MainActivity"
        android:configChanges="orientation|screenSize"
        android:label="@string/app_name"
        android:launchMode="singleTask" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activit>

构建.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.blabla.testapp1"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0.0"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.1.0'
}

在您的清单,我看到你写的activit而不是activity 让它好起来

<activity
     android:name=".MainActivity"
    android:configChanges="orientation|screenSize"
    android:label="@string/app_name"
    android:launchMode="singleTask" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>
  相关解决方案