Why can't I see default icon in the action bar?

Donovant

I thought I could be able to display the icon on the action bar, but as you can see it's no working, where's the problem? Maybe it depends on the compiledSdkVersion.

My manifest is the default one

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.fulvio.bitsandpizzas">

    <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=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

My build.gradle:

[![android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "com.example.fulvio.bitsandpizzas"
        minSdkVersion 17
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: \['*.jar'\])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.2.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.1'
    testCompile 'junit:junit:4.12'
}

Android Main Action screen

MarcGV

The icon is not showed in the Toolbar (the new ActionBar) by default in the newest versions of Android and if you put it manually it won't follow the material design guidelines:

https://material.io

If you want to put it anyway, you could create a toolbar.xml with your AppBar and custom Toolbar and use it in activities including your toolbar layout :

<include layout="@layout/your_layout">

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Function going too slowly...i can't see why

From Dev

Why can´t I see complete name in SSMS result list?

From Dev

Why can't I see the iOS 7.0 simulator in Xcode on Yosemite?

From Dev

Why can't I see GC roots?

From Dev

Can't set hex color and view the icon on the action bar using Theme.AppCompat

From Dev

Why I can't see bottom of scroller bar

From Dev

Why can't I see the icon that is compiled inside my Windows program as a binary Resource?

From Dev

Why can't I see HttpUtility.ParseQueryString Method?

From Dev

How can i add this icon to my action bar?

From Dev

Can't change icon color in action bar

From Dev

Why I see Do not request Window.FEATURE_SUPPORT_ACTION_BAR?

From Dev

Why I can't see the thumbnails in Nautilus?

From Dev

Why can't I see gnome extensions?

From Dev

I can't see default value for instance "char" in java

From Dev

Why I can't see the thumbnails in Nautilus?

From Dev

why Can't I see the map

From Dev

Why can't I see gnome extensions?

From Dev

Why don't I see network manager icon on the GNOME top bar?

From Dev

can't see search in action bar

From Dev

How Can I set Action bar button icon by Java code

From Dev

Why can't I see the menu I created?

From Dev

Why I can't see Top bar, after navigationcontroller go back programmatically

From Dev

Can't change icon color in action bar

From Dev

Can't change the ionic default icon in status bar when receive a push notification

From Dev

Why can't I see the manual for > but can see it for [?

From Dev

I can't see my app icon in my phone

From Dev

Why I can't see icon images on UWP?

From Dev

Why can't I see what branch I am in?

From Dev

Why can't I see nested args?

Related Related

HotTag

Archive