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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:13:10+00:00 2026-06-15T11:13:10+00:00

I need to refresh my activity. I have bunch of question regrading the same

  • 0

I need to refresh my activity. I have bunch of question regrading the same which advice me to finish current activity and restart the current activity. OR again provide value to each widget. To avoid transition I used this code

Intent intent = getIntent();
overridePendingTransition(0, 0);
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
this.finish();

overridePendingTransition(0, 0);
startActivity(intent);

But in my case In my activity I have four tabs, and I need to refresh all four tabs.

There are few more problems regarding the same
1) With above code, if I am on other screen, I come back to this screen when above piece of code runs.

2) Activity sequence gets disturb.

3) Maintaining selected tab will also be a part of problem

Even if I try to refresh each tab seperatley, One of my tab have webview. how to refresh that as webview.loadData() can’t be called unless there is view and since I am not on that tab there will no view.

What can be the ideal way to tackle this problem. Any help will be appreciated.

  • 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-15T11:13:11+00:00Added an answer on June 15, 2026 at 11:13 am

    Question was not much complicated but solution what I wanted got to be optimised. Finally I took the second way, ie refreshing each component. This approach overcomes the problem of disturbing the sequence of activity. For web view I am still using webView.loadData(...).

    In total I have handeled each tab separately. If I include my entire code then it would become clumsy, but still trying to incorporate as many important feature.

    In my activity class when I need to refresh my activity, I called this method.

    private void onRefrash()
    {   
        refreshCurrentActivity();
    
        int selectedTab = getActionBar().getSelectedNavigationIndex();
        switch (selectedTab)
        {
        case TAB1:
            fragment1.update();
            break;
        case TAB2:
            fragment2.update();
            break;
        case TAB3:
            fragment3.update();
            break;
        }       
    Toast.makeText(this, getString(R.string.msg_case_updates_received), Toast.LENGTH_LONG).show();  
        }                       
    }
    

    Each fragment is earlier initialised, and update method is called for each tab in which I am updating the corresponding web view.

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

Sidebar

Related Questions

I need to refresh my Activity once i click my Tab activity back. Currently
I have a webpage that contains a form, and i need to refresh the
Have a problem. In my main Activity I have a ListView. And I need
I need some help :) I have a tab activity with four sub activities.
I need to refresh TextViews every 5 seconds, I have created TimerTask( and set
Hi I have an application which after login, loads a main activity which contains
I need refresh a part of my page and I use this script which
I have implemented a thread in android which refresh the fragment (some text list
I just need to refresh a ListView with a Feed, which you recommend me
i need to refresh combo box (sub category ) related to what i choose

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.