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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:31:44+00:00 2026-06-13T09:31:44+00:00

I’m developing a simple android game divided into levels. I want a check icon

  • 0

I’m developing a simple android game divided into levels. I want a check icon (ImageView) to appear next to a level button (on level select menu) when that level is completed.
A level is completed after pressing a button, as follows (InsideLevelActivity):

    final EditText level1editText=(EditText)findViewById(R.id.level1editText);        
    Button level1completeButton=(Button)findViewById(R.id.level1completeButton);

    level1completeButton.setOnClickListener(new View.OnClickListener()
        public void onClick(View v)
        {
            final String edittext=level1editText.getText().toString();

            if(edittext.trim().equals("Complete level"))
             {   

              {
                Intent visible1 = new Intent();
                visible1.putExtra("iconvisible",0);
                startActivity(visible1);

                    {
                      LayoutInflater inflater = getLayoutInflater();
                      View view = inflater.inflate(R.layout.activity_level1completed,
                      (ViewGroup) findViewById(R.id.img11_toast));

                Toast toast = new Toast(Level1Activity.this);
                toast.setView(view);
                toast.show();

                { onBackPressed(); {

                        return;
                    }


            }   

            }
            else
            {
                    Toast.makeText(Level1Activity.this,
                    "Type Complete level.", Toast.LENGTH_LONG).show();
            }

And then returns to level select menu activity. I’m trying to retrieve data this way (LevelMenuActivity):

ImageView logocheckicon1=(ImageView)findViewById(R.id.logocheckicon1);
logocheckicon1.setVisibility(View.GONE);

Intent visible1 = getIntent();
int state = Integer.parseInt(visible1.getExtras().get("iconvisible").toString());
complete1.setVisibility(iconvisible);

I’ve tried many approaches for the last couple of days, including this one (how to pass data between two activities). I’ve even tried to make the check icon (ImageView) invisible, and making it visible again this way.

Also, the same check icon will appear next to every completed level. Is it possible to acomplish this with only one ImageView (without creating 10 different IDs of the same drawable)?

Thank you in advance.

EDIT:
I apologize if i wasn’t clear enough. I tought there was some way to change the visibility of an image located, for instance, on MainActivity with an intent inside the button on another activity.
Thank you for your answers.

EDIT2: Added the code of another unsuccessful try.

  • 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-13T09:31:46+00:00Added an answer on June 13, 2026 at 9:31 am

    To Pass image from one activity to another activity. At First convert image into Bitmap then base64 then convert string then pass it via intent or save share-preference.

      public boolean saveImage(Context context, Bitmap realImage) {
    
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
             realImage.compress(Bitmap.CompressFormat.JPEG, 100, baos);   
             byte[] b = baos.toByteArray(); 
    
            String encodedImage = Base64.encodeToString(b, Base64.DEFAULT);
    
        }
    

    Then take this image in another activity via intent or get from share-preference

    public Bitmap getFacebookImageBitmap(Context context)
    {
         Bitmap bitmap = null;
    
         String saveimage=from intent or share-preference string.
         if( !saveimage.equalsIgnoreCase("") ){
                byte[] b = Base64.decode(saveimage, Base64.DEFAULT);
                 bitmap = BitmapFactory.decodeByteArray(b, 0, b.length);
    
            }
        return bitmap;
    }
    

    Thanks

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I want to show the soap response to UIWebview.. my soap response is, <p><img

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.