Icon not showing in Menu using AVD - android

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

Related

Shrunk themed icon in Samsung devices

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

error: resource style/AppTheme.NoActionBar (aka com.example.musicstream:style/AppTheme.NoActionBar) not found

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

Xamarin No resource found that matches the given name (at 'theme' with value '#style/DesignTheme'). App1.Droid

I am new to Xamarin. So I started a shared project. Then I google some link to add material design and did the following.
I created the styles.xml.(I dont understand why the resources/value folder is not seen in visual studio but when I manually go the directory I could see so I created manually in there with the following content.
<?xml version="1.0" encoding="UTF-8" ? >
<resources>
<style name="DesignTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="windowNoTitle" >true </item >
<item name="windowActionBar" >false </item >
<item name="colorPrimary" >#color/primary </item >
<item name="colorPrimaryDark" >#color/primary_dark </item >
<item name="colorAccent" >#color/accent </item >
</style >
</resources >
Next I change the manifest as below.I added this android:theme="#style/DesignTheme"
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="15" />
<application android:label="App1.Droid" android:theme="#style/DesignTheme"></application>
</manifest>
I just tried to build and I got this error No resource found that matches the given name (at 'theme' with value '#style/DesignTheme'). but the manifest shows this now. Why is it different then in step 2?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="App1.Droid">
<!--suppress UsesMinSdkAttributes-->
<uses-sdk android:minSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application android:label="App1.Droid" android:theme="#style/DesignTheme" android:name="android.app.Application" android:allowBackup="true" android:icon="#drawable/icon" android:debuggable="true">
<activity android:configChanges="orientation|screenSize" android:icon="#drawable/icon" android:label="App1" android:name="md50170a25da682dd459b9251c65ebe3a7a.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<provider android:name="mono.MonoRuntimeProvider" android:exported="false" android:initOrder="2147483647" android:authorities="App1.Droid.mono.MonoRuntimeProvider.__mono_init__" />
<!--suppress ExportedReceiver-->
<receiver android:name="mono.android.Seppuku">
<intent-filter>
<action android:name="mono.android.intent.action.SEPPUKU" />
<category android:name="mono.android.intent.category.SEPPUKU.App1.Droid" />
</intent-filter>
</receiver>
</application>
</manifest>
The full error is .
No resource found that matches the given name (at 'theme' with value '#style/DesignTheme'). App1.Droid C:\Users\ns\Documents\Visual Studio 2015\Projects\App1\App1\App1.Droid\obj\Debug\android\manifest\AndroidManifest.xml
Under the Nuget Package Manager I can see the installed list shows this Xamarin.Android.Support.Design is installed for version v24.2.1
in MainActivity, in
[Activity(Label = "appName", ScreenOrientation = Android.Content.PM.ScreenOrientation.Portrait, MainLauncher = true)]
Remove them.

error: No resource identifier found for attribute 'showAsAction' in package 'android' Y it is showing this error

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>

change android label name and color in androidmanifestfile

Hi i have to developed one sample app.Here i wish to select the app name is Admin Login and gravity is center and background color is #465371 ,textcolor is #ffffffff.now i have to run the app means the label name only changed here.the gravity and background,textcolor is does not change here.please give me solutions for this.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.androidlogin.ws"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".AndroidLoginExampleActivity"
android:label="Admin Login" android:background="#465371" android:textColor="#ffffffff" android:gravity="center">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
i got the o/p like this:
You can do all into your custom titlebar. For the custom titlebar check this link.
https://stackoverflow.com/a/3438352/1263679

Categories

Resources