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

  • SEARCH
  • Home
  • 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 7884757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:53:14+00:00 2026-06-03T04:53:14+00:00

i am new to android development and i am now developing a project. This

  • 0

i am new to android development and i am now developing a project. This project is about loading a picture to the screen using bitmap. After loading the picture into the screen, i want to add some icon/drawable on top of the loaded bitmap and then save it.

Here is part of my codes which used for load a single image to the screen.

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    // TODO Auto-generated method stub
    super.onActivityResult(requestCode, resultCode, data);

    switch (requestCode){
    case SELECT_PICTURE_ACTIVITY_REQUEST_CODE:
        if (resultCode == RESULT_OK){
            Uri selectedImage = data.getData();
            String[] filePathColumn = {MediaStore.Images.Media.DATA};
            Cursor cursor = getContentResolver().query(selectedImage, filePathColumn,
                    null, null, null);
            if (cursor.moveToFirst()){
                int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
                String filePath = cursor.getString(columnIndex);
                Bitmap bitmap = BitmapFactory.decodeFile(filePath);
                targetImage.setImageBitmap(bitmap);
            }
            cursor.close();
        }
        break;
    }
}

Here is my xml code:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<ImageView
    android:id="@+id/background"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
</ImageView>

my xml code contains just an which means the whole screen are going to used for displaying my picture.

Now, i am facing a problem with how to load some icons or drawable on top my bitmap and then save it? I have a “add” option in my optionmenu, i expect that when i press “add” button in the option menu, there is a list show some icon/drawables in my drawable file, and after i selected a icon, the selected icon will appear on top of my original bitmap picture. Also, i expect i can drag the icon to arbitrary location and then save it.

Please give me a help and it is very urgent!

Thanks a lot!

  • 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-03T04:53:16+00:00Added an answer on June 3, 2026 at 4:53 am

    I’m not 100% sure why you are approaching the problem this way. I think a standard layout with the background set to your primary drawable would work better, but I believe a LayerDrawable is what you are looking for.

    Drawable[] layers = new Drawable[2];
    layers[0] = bitmap;
    layers[1] = icon;
    ... add more here
    
    LayerDrawable layerDrawable = new LayerDrawable(layers);
    targetImage.setImageDrawable(layerDrawable);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to android development and now i am developing an e commerce
Hey guys i am new to android development, I am developing a project which
I am new to android. I using emulator for my development right now ,
friends I am new to iphone development, I have mostly worked with Android, now
I am new to Android development and facing a problem while using AndEngine. I
I'm breaking my head over this one. I'm kind of new in android development.
Hi there Im new to mobile application development. I had developed Android apps using
I'm brand new to Android development and right now I am building a simple
I'm new to android development and as a pet project I wanted to try
Im new to this android development, and im currently playing around with the HelloM4A

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.