Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8868393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:15:45+00:00 2026-06-14T17:15:45+00:00

I am using MonoDevelop for Android and i am trying to create a Drawable

  • 0

I am using MonoDevelop for Android and i am trying to create a Drawable variable from an image in the resources folder.

I have the following files in my Resources\drawable folder:

Icon.png
monkey.png
monkeyPurple.png

How do I create a Drawable variable that has the image obtained from one of these files?

I have tried the following code:

Drawable icon = Drawable.CreateFromPath("Icon.png");

This however does not work. If this is the correct way to load an image from file, do I need to have the full filename and path to the file? I have tried many combinations to access the image, with no luck.

I have also tried the following:

Drawable icon = R.getResources().getDrawable(R.drawable.Icon); 
Drawable icon = R.getResources().getDrawable(R.drawable.monkey);

Also with no luck.

Can I please have some help in correctly creating a Drawable variable that has an image from the resource folder?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:15:46+00:00Added an answer on June 14, 2026 at 5:15 pm

    You’re very close, but I think you’re mixing Java and C#.

    You can access this using the Resource structure. I’ve put both the Mono for Android and Java versions below for reference but in your case you want the C# version if you’re using Mono for Android.

    Mono for Android (C#)

    Drawable icon = Resources.GetDrawable(Resource.Drawable.Icon);
    

    Android SDK (Java)

    Resources res = getResources();
    Drawable icon = res.getDrawable(R.drawable.Icon);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have begun evaluating MonoDroid. (I've built many apps using Android+Eclipse) I created new-from-template
I'm using MonoDevelop (Android C#). Is there a way to get values from a
I have a few problems regarding using ActionBarSherlock example and mono for android. Monodevelop
I'm new to Mono for Android (using MonoDevelop) and Android development in general. I
We have a team that built an agent in Mono using MonoDevelop on Mac
I am using MonoDevelop and MonoTouch to create an application which needs to access
i'm using MonoDevelop after used Eclipse for several years. In eclipse when i create
I'm converting a small c# application from windows to osx using MonoDevelop and MonoMac.
I have created a c# application in ubuntu using monodevelop. It is running well
In MonoDevelop I have the following code which compiles: int[] row = new int[indices.Count]{};

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.