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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:35:28+00:00 2026-05-28T02:35:28+00:00

I have an activity which shows an image (ViewCollection.java). I want to only create

  • 0

I have an activity which shows an image (ViewCollection.java). I want to only create it once, then re-use that instance to further show more images from different calls (The activity is expensive to initialize).
So far, I launched the activity like this:

Intent i = new Intent(this, ViewCollection.java);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(i);

And all activity calls from the ViewCollection activity are also called by the same method.
But despite this, the activity keeps getting destroyed when I start other activities from it…
What can I do to fix this?

*PS: The activity is set to “standard” launch mode

  • 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-05-28T02:35:29+00:00Added an answer on May 28, 2026 at 2:35 am

    Set the activity launchmode to singletop or set the flag FLAG_ACTIVITY_SINGLE_TOP .
    Handle the intent in onNewIntent()
    You can get further details here

    Edit: Though if back key is pressed on the activity or configuration changed since last time you entered the app, the activity will still be recreated

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

Sidebar

Related Questions

i have an app widget, which contains only one imageview. i redraw that image
I have an activity which shows some List entries. When I click on a
So what I am trying to create is an activity that displays an image
i got the following problem. I want to have an activity thats shows me
I have an activity which shows 3 random images from JSON data off the
I have an onClickListener that should call a class that shows and image from
I have a JSON file which is populated to an activity (Main.java). This Activity
I have a ListView on main activity, which shows a Contact picture on the
I have a question that I have an image which is shown on an
I have a ImageView which shows a picture that has been taken from the

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.