• 4

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191


File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

I have created a new Image Assets in the Drawable cus I need to insert a new image in my app, but every time I create a new image asset, the output turns to be no colour at all. I've attached the pic of it.enter image description here

It's confusing and whenever I import it in my layout, it's just grey all over as you can see in the image. Why is it cus I can't find any ready solutions? Let me know if I'm overlooked.

I got the answer for my own question which I find it's useful for some who still do not know how to enable the Batch Drawable Import. It's easy and just need to download plugin and install. I've read that the latest version already has it and I've downloaded and reinstalled, but it didn't show as what I was expecting. The solution is to download and install it.

  1. First, In Android Studio, go to Default Setting File --> Setting or you can simple Click the SDK Manager Icon enter image description here

  2. In the Default Setting, go to Plugins enter image description here

  3. In the search option, type Batch Drawable Import and you'll see there's Android Drawable Importer. enter image description here

  4. In my image, it's already installed, Click Install Plugin and just follow the instructions.

  5. You'll have to restart Android Studio and try to create a new Batch Drawable Import and you'll find it there. ;) Thanks. enter image description here

  • 66
Reply Report

While creating a new asset in the drawable folder you need to set the

"Launcher icons"

in the

"Asset Type "

drop down enter image description here

This will add the images in their original color and will not be greyed out. Also it is possible it adds the images in res/mipmap folder. You can move the images from mipmap folder to anywhere you want.

  • 13
Reply Report
      • 2
    • Thanks and it works ;) I've followed one of the answers on here but it didn't work..thanks again.
      • 2
    • Doesn't works at all. When I select "Action Bar and Tab Icons", the image is grey like the question and if I select "Launcher Icons", the image becomes black.
    • For me, when I import my images as launcher items, they look great but are unusable as ImageButtons within the app. Am I missing something about the types of images I can import?

When you create a Image Asset as Action bar and Tab icons in the newer version of Android Studio(2.2) it is automatically converted into grey scale,Choose theme from the drop down default is HOLO LIGHT choose custom and you could be able to give the color code,but this works only for sketches kinda images To get color code

  • 0
Reply Report

I Found the proper solution! You just have to add this code where you created your NavigationView object!

    NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
    //add the line below and your icon will display as your .svg file
  • 0
Reply Report