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 8961253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:50:46+00:00 2026-06-15T15:50:46+00:00

b2.setOnClickListener(new OnClickListener() { public void onClick(View v) { setContentView(R.layout.new_main); String editTextStr = text.getText().toString(); Toast

  • 0
b2.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                setContentView(R.layout.new_main);

                String editTextStr = text.getText().toString();
                Toast msg = Toast.makeText(getBaseContext(),"/sdcard/Stored_Images/" + editTextStr + ".jpg", Toast.LENGTH_LONG);
                msg.show();

                Bitmap bmp = BitmapFactory.decodeFile("/sdcard/Stored_Images/" + editTextStr + ".jpg");
                ImageView img = (ImageView) findViewById(R.id.ImageView01);
                img.setImageBitmap(bmp);
            }
        });

The code above displays an image on the screen that is saved on the sd card.

Canvas c = holder.lockCanvas();
c.drawARGB(255,0,0,0);
onDraw(c);
holder.unlockCanvasAndPost(c);

This code creates a canvas to draw on (black screen).

I want to be able to combine the two to set/display an image as the canvas so that I can draw on it. So if i take a picture of someones face, I want to be able to display that image so that I can draw a mustache or something on it.

  • 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-15T15:50:48+00:00Added an answer on June 15, 2026 at 3:50 pm

    You are probably better off creating the canvas, adding the bitmap image to it and then handling the user touch/drawing from there.

    Bitmap bmp = BitmapFactory.decodeFile("/sdcard/Stored_Images/" + editTextStr + ".jpg");
    mCanvas = new Canvas(bmp);
    

    then for the drawing… sound like you have that figured out, but if not you can check out the fingerPaint samples from the api demos that demonstrate drawing on a canvas (which you would have your image on at that point.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

button.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { db.update(); } }); On line
Code: button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // fileReader(); new xyz().execute(); }//
My timer code is: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); initializer(); fire.setOnClickListener(this); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.picture_choice_activity); Button takePictureButton = (Button)findViewById(R.id.takePictureButton); takePictureButton.setOnClickListener(new OnClickListener()
I am invoking a mail intent in ImageButton mail=(ImageButton)findViewById(R.id.mailgps); mail.setOnClickListener(new View.OnClickListener() { @Override public
I have this code: public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.inventario); Button scatta=(Button) findViewById(R.id.scatta_foto); scatta.setOnClickListener(new
Do you know why this make my application to close unexpectedly: b2.setOnClickListener(new View.OnClickListener() {
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); txtUserName=(EditText)this.findViewById(R.id.txtUname); txtPassword=(EditText)this.findViewById(R.id.txtPwd); btnLogin=(Button)this.findViewById(R.id.btnLogin); btnLogin=(Button)this.findViewById(R.id.btnLogin); btnLogin.setOnClickListener(new OnClickListener()
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); txtUserName=(EditText)this.findViewById(R.id.txtUname); txtPassword=(EditText)this.findViewById(R.id.txtPwd); btnLogin=(Button)this.findViewById(R.id.btnLogin); Button btnLogin=(Button)this.findViewById(R.id.Button01); btnLogin.setOnClickListener(new
I am getting the following error: The constructor Intent(new View.OnClickListener(){}, Class<DrinksTwitter>) is undefined In

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.