Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android.app.Application #5

Open
Mohdx opened this issue May 20, 2024 · 1 comment
Open

android.app.Application #5

Mohdx opened this issue May 20, 2024 · 1 comment

Comments

@Mohdx
Copy link

Mohdx commented May 20, 2024

Dear Mr @SNNafi
Thank you for this package, appreciate it!

I have app name "MES"
on Huawei nova 5T, Android 10.
If you try to uninstall the app, you get this message:
Screenshot_20240520_092937

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <application
        android:name="${applicationName}">
        <activity-alias
            android:name="appicon.DEFAULT"
            android:enabled="true"
            android:exported="true"
            android:icon="@mipmap/ic_launcher"
            android:label="MES"
            android:targetActivity=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity-alias>
        <activity-alias
            android:name="appicon.MES"
            android:enabled="false"
            android:exported="true"
            android:icon="@mipmap/ic_launcher2"
            android:label="MES"
            android:targetActivity=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity-alias>
        <activity
            android:name=".MainActivity"
            android:exported="true"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <!-- <category android:name="android.intent.category.LAUNCHER"/> -->
            </intent-filter>
        </activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
    <!-- Required to query activities that can process text, see:
         https://developer.android.com/training/package-visibility?hl=en and
         https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.

         In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
    <queries>
        <intent>
            <action android:name="android.intent.action.PROCESS_TEXT"/>
            <data android:mimeType="text/plain"/>
        </intent>
    </queries>
</manifest>
@pozi119
Copy link

pozi119 commented Oct 29, 2024

Use the following solution:

  <application
    android:allowBackup="true"
    android:name="${applicationName}"
    android:icon="@mipmap/icon_00" // Don't delete
    android:label="@string/app_name"  // Don't delete
    android:roundIcon="@mipmap/icon_00_round">  // Don't delete
    <activity
      android:name=".MainActivity"
      android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
      android:enableOnBackInvokedCallback="true"
      android:enabled="false"  // Use AppIcon.icon_00 as the default icon, set to false here
      android:exported="true"
      android:hardwareAccelerated="true"
      android:launchMode="singleTop"
      android:screenOrientation="portrait"
      android:taskAffinity=""
      android:theme="@style/LaunchTheme"
      android:windowSoftInputMode="adjustResize"
      tools:ignore="DiscouragedApi,LockedOrientationActivity">
      <meta-data
        android:name="io.flutter.embedding.android.NormalTheme"
        android:resource="@style/NormalTheme" />

      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />   // Don't delete
        <action android:name="android.intent.action.VIEW" />
      </intent-filter>
    </activity>
    <activity-alias
      android:label="name1"
      android:name="AppIcon.icon_00"
      android:enabled="true" // Default icon, set to true
      android:exported="true"
      android:icon="@mipmap/icon_00"
      android:roundIcon="@mipmap/icon_00_round"
      android:targetActivity=".MainActivity">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity-alias>
    <activity-alias
      android:label="name2"
      android:name="AppIcon.icon_01"
      android:enabled="false"  // Non default icon, set to false
      android:exported="true"
      android:icon="@mipmap/icon_01"
      android:roundIcon="@mipmap/icon_01_round"
      android:targetActivity=".MainActivity">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity-alias>
    ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants