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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:53:13+00:00 2026-06-12T08:53:13+00:00

In android TabActivity . I want to reload a tab each time it is

  • 0

In android TabActivity. I want to reload a tab each time it is visited. for example, if there is a tab that get data from the database, I want to fetch data each time the tab activity is appeared .

Where I need to put the operations that get data from database, on onCreate function, onResume .. ??

  • 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-12T08:53:14+00:00Added an answer on June 12, 2026 at 8:53 am

    use like this first Tab

    public class TabsActivity extends TabActivity {
    
    TabSpec spec1 = tabHost.newTabSpec("tabone");
    spec1.setIndicator(createTabView(tabHost.getContext(), "tabone", R.drawable.tab_home));
    Intent inte = new Intent(TabsActivity.this, PhotosActivity.class);
    inte.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    spec1.setContent(inte);
    
    
    TabSpec spec2 = tabHost.newTabSpec("tabtwo");
    spec2.setIndicator(createTabView(tabHost.getContext(), "tabtwo", R.drawable.tab_account));
    Intent _int = new Intent(TabsActivity.this, TabTwoActivity.class);
    _int.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    spec2.setContent(_int);
    
    tabHost.addTab(spec1);
    tabHost.addTab(spec2);
    

    an second Tab

        public class TabTwoActivity extends TabActivity {
    
       TabSpec spec1 = tabHostacc.newTabSpec("tabone");
    spec1.setIndicator(createTabView(tabHostacc.getContext(), "tabone", R.drawable.tab_home));
    Intent inte = new Intent(TabTwoActivity .this,  yourfirstActivity.class);
    inte.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    spec1.setContent(inte);      
    
    TabSpec spec2 = tabHostacc.newTabSpec("tabtwo");
    spec2.setIndicator(createTabView(tabHostacc.getContext(), "tabtwo", R.drawable.tab_account));
    Intent _int = new Intent(TabTwoActivity .this, yoursecondActivity.class);
    _int.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    spec2.setContent(_int);      
    
    tabHostacc.addTab(spec1);
    tabHostacc.addTab(spec2);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have TabActivity in android project which contains some tabs. In each tab i
Android programming. I have a json returning the date from a database as a
I have a TabActivity that hosts other three activities. If the first tab is
Here i make 5 Tab buttons that are working proper but now i want
I have been using TabActivity and I want the tab to display on every
I am creating a three tabs that contains one fragment each now I want
When I select a city from my 3rd tab, I want to it to
i am working in android. I want to make TabHost and Tab widget. this
I have a tab bar that I want to add to multiple activities. I
package com.example.helloandroid; import java.util.ArrayList; import java.util.Arrays; import android.app.TabActivity; import android.os.Bundle; import android.view.Window; import android.widget.ArrayAdapter;

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.