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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:41:14+00:00 2026-06-14T04:41:14+00:00

I really don’t know how to solve this, I have found many many solutions

  • 0

I really don’t know how to solve this, I have found many many solutions but still it does not work.

My problem is after my activiy jump to TabHost, the tab pageview turn out blank, but when I switch the tab, it’s turn normal.

I guess the date has ready when the activity first jump, but why it doesn’t show normal?

Any help will very appreciate..

This it the activity where the jumped TabHost at.

public class ListContainActivity extends FragmentActivity{

    public static final String tag = "COOLSMILE_DEBUG";
    private  TabHost tabHost ;
    ContextTask contextTask ;
    String mString="";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.showcontain);
        ProgressRefresh();
    }

    private void InitUI(){
        getIntentExtra();
        Log.v(tag, "----------- InitUI start -----------");
        InitTabHost();
    }

    private void InitTabHost(){

        Log.v(tag, "----------- InitTabHost start -----------");
        TabHost.TabSpec spec;  

        tabHost = (TabHost) findViewById(android.R.id.tabhost);
        tabHost.setup();

        spec=tabHost.newTabSpec("Refresh").setIndicator("Refresh").setContent(R.id.contain_tab0);
        tabHost.addTab(spec);  

        spec=tabHost.newTabSpec("Love").setIndicator("Love").setContent(R.id.contain_tab1);  
        tabHost.addTab(spec);  

        spec=tabHost.newTabSpec("Comment").setIndicator("Comment").setContent(R.id.contain_tab2);  
        tabHost.addTab(spec);  

        spec=tabHost.newTabSpec("Onward").setIndicator("Onward").setContent(R.id.contain_tab0);  
        tabHost.addTab(spec);  

        spec=tabHost.newTabSpec("Goback").setIndicator("Goback").setContent(R.id.contain_tab1); 
        tabHost.addTab(spec);  

        InitClickListener();
    }
    private void ProgressRefresh(){        

        Log.v(tag, "----------- progress_refresh start -----------");
        contextTask = new ContextTask(0);

        TaskHost taskHost = new TaskHost(){

            @Override
            public void onPreExecute(int requestCode) {
                // TODO Auto-generated method stub
                super.onPreExecute(requestCode);
                Log.v(tag, "----------- progress_refresh.onPreExecute() start -----------");
                InitUI();
            }

            @Override
            public void onPostExecute(int requestCode, String result) {
                // TODO Auto-generated method stub
                super.onPostExecute(requestCode, result);

                Log.v(tag, "----------- progress_refresh.onPostExecute() start -----------"+result);

                TextView txt = (TextView)findViewById(R.id.text_Result);
                txt.setText("DoInBackground Result :"+result);
                TextView txt1 = (TextView)findViewById(R.id.text_Refresh);
                txt1.setText("Hello my name is "+mString);
            }
        };
        contextTask.setTaskHost(taskHost);
        contextTask.setProgress(new SimpleDialogProgress(this,"正在获取数据..."));
        contextTask.execute();        
    }

    private void InitClickListener(){

        Log.v(tag, "----------- InitClickListener start -----------");

        RadioGroup radioGroup=(RadioGroup) this.findViewById(R.id.main_tab);  
        radioGroup.setOnCheckedChangeListener(new OnCheckedChangeListener() {  

            @Override  
            public void onCheckedChanged(RadioGroup group, int checkedId) {  
                // TODO Auto-generated method stub  
                switch (checkedId) {  
                    case R.id.main_tab_addHome:
                        tabHost.setCurrentTabByTag("Refresh");  
                        break;
                    case R.id.main_tab_addExam:  
                        tabHost.setCurrentTabByTag("Love");  
                        break;  
                    case R.id.main_tab_myExam:  
                        tabHost.setCurrentTabByTag("Comment");  
                        break;  
                    case R.id.main_tab_message: 
                        tabHost.setCurrentTabByTag("Onward");  
                        break;  
                    case R.id.main_tab_settings:
                        tabHost.setCurrentTabByTag("Goback");  
                        break;  
                    default:  
                        tabHost.setCurrentTabByTag("Refresh");  
                        break;  
                }  
            }  
        });              
    }

    private void getIntentExtra(){
        Intent intent = getIntent();
        mString = intent.getExtras().getString("PRESIDENTS_CONTENT");
    }

}
  • 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-14T04:41:15+00:00Added an answer on June 14, 2026 at 4:41 am

    I have find the reason,it’s because the Tag and setContent(R.id.contain_tab1) isn’t One-to-one relationship.I thought just set it one time before,now I have solve the question.

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

Sidebar

Related Questions

I have this problem and really don't know how to solve this. I'm having
I'm stuck on a problem I really don't know how to solve: I have
I really don't know how to title this question, but I need some help
I...really don't know how to word the title better. But basically, what I have
I really don't know how to express this question. But what I'm trying to
I really don't know what to do anymore... I got this code (tried many
Not really sure how to ask this question because I really don't know what
I really don't know what I'm doing with SQL, but I have two tables.
I really don't know where to begin with this question, but the site I'm
I really don't know how to ask this question or title it but here

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.