The icon's circular mask is shrunk on Samsung device but on other devices his appearance is normal.
ic_launcher.xml:
`
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="#mipmap/ic_launcher_background"/>
<foreground android:drawable="#mipmap/ic_launcher_foreground"/>
<monochrome android:drawable="#drawable/ic_monochrome_icon" />
</adaptive-icon>
AndroidManifest:
`<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.demomonochrome">
<application
android:allowBackup="true"
android:dataExtractionRules="#xml/data_extraction_rules"
android:fullBackupContent="#xml/backup_rules"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.DemoMonochrome"
>
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
`
Monochrome Icon File:
<vector android:height="16dp"
android:viewportHeight="14"
android:viewportWidth="42"
android:width="48dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<group
android:pivotX="21"
android:pivotY="8"
android:scaleX="0.5"
android:scaleY="0.5"
>
<path android:fillColor="#4A454E" android:pathData="M41.394,4.431C39.192,6.36 37.238,6.48 34.892,4.754C33.813,3.96 32.847,3.015 31.766,2.226C30.929,1.615 30.044,1.01 29.089,0.633C27.437,-0.021 25.76,0.201 24.251,1.118C23.226,1.741 22.292,2.517 21.341,3.257C21.208,3.35/>
</group>
</vector>
Theme icon in Samsung Device Theme Icon in other devices
Related
I am trying to use adaptive icon in react native android but it product following error.
AAPT: error: unexpected element found in
here is my manifes.xml
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.anar">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.VIBRATE" />
<application android:name=".MainApplication" android:label="#string/app_name" android:icon="#mipmap/ic_launcher" android:roundIcon="#mipmap/ic_launcher_round" android:allowBackup="false" android:theme="#style/AppTheme">
<activity android:screenOrientation="portrait" android:launchMode="singleTop" android:name=".MainActivity" android:label="#string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<meta-data android:name="com.google.android.geo.API_KEY" android:value="MY_API_KEY_IS_HIDDEN"/>
<service android:name="io.invertase.firebase.messaging.RNFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service android:name="io.invertase.firebase.messaging.RNFirebaseBackgroundMessagingService" />
</application>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="#color/ic_launcher_background" />
<foreground android:drawable="#mipmap/ic_launcher_foreground" /> </adaptive-icon>
</manifest>
You have already apply adaptive-icon using android:icon and android:roundIcon. Try to remove those extra code from AndroidManifest.xml
<application
android:icon="#mipmap/ic_launcher"
android:roundIcon="#mipmap/ic_launcher_round"
...>
<!--<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="#color/ic_launcher_background" />
<foreground android:drawable="#mipmap/ic_launcher_foreground" />
</adaptive-icon> -->
If you check inside ic_launcher_round.xml, you will see those code there, If not then follow below steps to create one:
Create a folder mipmap-anydpi-v26 under res
Create a file ic_launcher_round.xml under mipmap-anydpi-v26
Place below code inside ic_launcher_round.xml
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="#color/ic_launcher_background"/>
<foreground android:drawable="#drawable/ic_launcher_foreground"/>
</adaptive-icon>
Update: I have checked the resources that the site provide, It contains every things, just remove adaptive-icon related code from AndroidManifest.xml and keep in mind that adaptive icon only works from API level 26
Check official documentation for more details
At first my AccessibilityService works well, but when I reboot my Galaxy S10, the service is closed , then I open it manually. I think the service will work same as before , but it doesn't respond anything , even the "onServiceConnected()" is not called.
I tried my code on Galaxy S10 , Android 9 , One UI 1.1 .
<accessibility-service xmlns:android="http://schemas.android.com/apk/res/android"
android:packageNames="com.android.settings"
android:description="#string/xxx"
android:accessibilityEventTypes="typeWindowContentChanged|typeWindowStateChanged"
android:accessibilityFlags="flagDefault|flagReportViewIds"
android:accessibilityFeedbackType="feedbackAllMask"
android:canRetrieveWindowContent="true"
/>
I tried my code in an Android 9 phone as well, even my service not shown in settings->accessibility...
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.reviewassistant">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/reviewassistant"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name=".AssistantService"
android:enabled = "true"
android:exported = "true"
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
<intent-filter>
<action android:name="anroid.accessibilityservice.AccessibilityService" />
</intent-filter>
<meta-data
android:name="android.accessibilityservice"
android:resource="#xml/config_accessibility"/>
</service>
</application>
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<accessibility-service xmlns:android="http://schemas.android.com/apk/res/android"
android:description="#string/app_name"
android:accessibilityEventTypes="typeAllMask"
android:accessibilityFeedbackType="feedbackAllMask"
android:canRetrieveWindowContent="true"
android:notificationTimeout="100"
android:accessibilityFlags="flagReportViewIds"
android:packageNames="com.example.reviewassistant"
android:settingsActivity="com.example.reviewassistant.MainActivity"
/>
I am creating a music player but I cant seem to fix the error what do I need to do?
I tried looking it up online but couldn't fix it myself , I am really new to coding.
This is my manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.musicstream">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".Search"
android:label="#string/title_activity_search"
android:theme="#style/AppTheme.NoActionBar"></activity>
<activity android:name=".PlaySongActivity" />
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
This is my style.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#795496</item>
<item name="colorPrimaryDark">#7e20cb</item>
<item name="colorAccent">#795496</item>
</style>
</resources>
Thanks in advance!
This error is because Android Studio cannot resolve the symbol "#style/AppTheme.NoActionBar" within your activity.
Replacing it with android:theme="#style/AppTheme solves the error.
change "#style/AppTheme" to #style/AppThemeTheme.AppCompat
My activity_main xml is not loading correctly it is giving that error.
it is showing the path error in \res\menu\main.xml:3
and my main.xml is :
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="#+id/action_settings"
android:orderInCategory="100"
android:showAsAction="never"
android:title="#string/action_settings"/>
</menu>
and here is my manifest file. Help will be much appreciated. :)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.javacodegeeks.android.audiocapturetest"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.javacodegeeks.android.audiocapturetest.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I have problem on this menu.I already set the icon for it,but it's not showing when I run my AVD,but if i will install this to my device it will work properly. can you help me on this please I am still learning android, why is it that it will not work on my AVD. Thank you in advance.
Here is my code
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="#+id/add"
android:title="Add"
android:icon="#drawable/ic_launcher"></item>
<item android:id="#+id/edit"
android:title="Edit"
android:icon="#drawable/ic_launcher"></item>
<item android:id="#+id/delete"
android:title="Delete"
android:icon="#drawable/ic_launcher"></item>
</menu>
This is my manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mymenu"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<application
android:debuggable="true"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.mymenu.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Your new Icon should be place in every drawable folders, then it will compatible with all