Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Can you change the App icon programmatically?

$
0
0

We have a MasterDetailPage and the icon used next to the menu button is the App icon.

That icon is set in the MainActivity.cs file in the Android project (if we compile for Android) as seen below:

using System;

using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;

namespace Klaim.Droid
{
    [Activity (Label = "MagiKlaim", Icon = "@drawable/logo_icon", ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation, Theme = "@android:style/Theme.Holo.Light")]
    public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity
    {
        protected override void OnCreate (Bundle bundle)
        {
            base.OnCreate (bundle);
            global::Xamarin.Forms.Forms.Init (this, bundle);

            LoadApplication (new App ());
        }
    }
}

Can we change logo_icon with something else through the PCL project either by affecting the MasterDetailPage or the App itself?


Viewing all articles
Browse latest Browse all 58056

Trending Articles