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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:11:28+00:00 2026-05-25T20:11:28+00:00

I am designing an app which is a kind of articles reader & manager

  • 0

I am designing an app which is a kind of articles reader & manager and articles available in different languages.

So when user reads a particular article in Russian there is a button to display the same article in English and vice versa.

To do that I start new activity.
What I have now is that if user presses “translate” button of the same article several times there will be heaps of duplicate activities.

What I need to achieve is that when user first “translates” Russian article to English, then presses “translate” button in an English article, the app returns him to existing activity displaying Russian Article and does not start a new Activity. Here is a code which does not do what I need to illustrate my attempts.

intent.putExtra("BookID", strBookID );
        intent.putExtra("ChapterNum", mCurrChapterNum );
        intent.putExtra("TextNum",   mCurrTextNum );

        try{                        
            if (Central.LastBookID.equals(""))
            {   //remember current article id
                Central.LastBookID=strBookID;
                Central.LastChapter=mCurrChapterNum;
                Central.LastText=mCurrTextNum;
            }
            else
            {
                if (Central.LastChapter.equals(mCurrChapterNum) &&
                        Central.LastText.equals(mCurrTextNum) )
                    intent.addFlags(Intent. FLAG_ACTIVITY_REORDER_TO_FRONT);
            }
            startActivity(intent);

Please give me some advice, maybe it would be better to implement it differently?
From what I managed to read, Android does not have any “Activity ID”s so that if I have 2 activities of the same class “A” in stack but with different parameters like (A1 A2), I could tell the system to bring to front activity A1 and make it (A2 A1)

  • 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-25T20:11:29+00:00Added an answer on May 25, 2026 at 8:11 pm
     intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    

    using the above flag instead will finish the prevoius one and starts the new one. so no heap of Activities and no extra logic.

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

Sidebar

Related Questions

I designing a Java desktop app which will open web page, allow user to
I have been designing my app to store local user data which is changed
I am designing an app for various platforms, in which the user is able
I am designing an app which will present large amounts of text that is
I am designing an app in which the data is stored in the database.
I'm designing a MFC app in which I'd like to have a grid with
I'm currently designing a smart client app (WPF) which needs to operate in an
I'm designing an Android app which loads lots of small (say 128x128px@24-bit) PNG images
I am designing an app in which i need to open an email client
I'm designing a Core Data app which needs to keep dated records. Imagine a

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.