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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:31:53+00:00 2026-05-26T20:31:53+00:00

I want to know when my TabActivity has inflated so i tried this code

  • 0

I want to know when my TabActivity has inflated so i tried this code

 @Override
 protected void onFinishInflate() {
     super.onFinishInflate();
 }

i get the error: must override or implement a supertype method
I cannot understand why that is not working in the TabActivity.
Can Anyone explane this?

package com.carlsberg.bungle.history;

import com.carlsberg.bungle.Consts;
import com.carlsberg.bungle.R;
import android.app.TabActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
import android.widget.TextView;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;

public class TabActivityHistoryLauncher extends TabActivity {

    private final String TAG = "TabActivityHistoryLauncher";    
    private TabHost tabHost;
    MyListener myListener;


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.tab_activity_history);

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

        Intent int2 = new Intent(this, ActivityTabGroup2.class);
        Intent int1 = new Intent(this, ActivityTabGroup1.class);

        tabHost.getTabWidget().setDividerDrawable(R.drawable.tab_divider);// Divider .9.png 
        setupTab(new TextView(this), getString(R.string.string_incoming),int1);
        setupTab(new TextView(this), getString(R.string.string_outgoing),int2);

        myListener = new MyListener();
        Intent intent = getIntent();

        if(intent != null){
            Bundle extras = intent.getExtras();
            if(extras != null){
                String outgoing = extras.getString(Consts.SWITSH_TO_OUTGOING);
                String incoming = extras.getString(Consts.SWITSH_TO_INCOMING);
                if(incoming != null){
                    tabHost.setCurrentTab(0);
                }else if(outgoing != null){
                    tabHost.setCurrentTab(1);
                }
            }
        }

    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();

    }


    private void setupTab(final View view, final String tag, Intent int1) {
        View tabview = createTabView(tabHost.getContext(), tag);

        TabSpec setContent = tabHost.newTabSpec(tag).setIndicator(tabview).setContent(int1);

        tabHost.addTab(setContent);
    }

    private static View createTabView(final Context context, final String text) {
        View view = LayoutInflater.from(context).inflate(R.layout.tab_history_a_tab, null);
        TextView tv = (TextView) view.findViewById(R.id.tabsText);
        tv.setText(text);
        return view;
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        if(intent != null){
            Bundle extras = intent.getExtras();
            if(extras != null){
                String outgoing = extras.getString(Consts.SWITSH_TO_OUTGOING);
                String incoming = extras.getString(Consts.SWITSH_TO_INCOMING);
                if(incoming != null){
                    tabHost.setCurrentTab(0);
                }else if(outgoing != null){
                    tabHost.setCurrentTab(1);
                }
            }
        }

    }   


    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (myListener != null) {
            unregisterReceiver(myListener);
        }   
    }
    @Override
    protected void onResume() {
        super.onResume();
        Log.d(TAG, "onResume ***********************************************************************"); 
        IntentFilter intentFilterInStart = new IntentFilter(Consts.COM_CARLSBERG_INCOMINGSTATUS_ACTION_START );
        IntentFilter intentFilterOutStart = new IntentFilter(Consts.COM_CARLSBERG_OUTGOINGSTATUS_ACTION_START );        
        registerReceiver(myListener, intentFilterInStart);
        registerReceiver(myListener, intentFilterOutStart);     
        //MyListenerIsRegistered = true;        

    }
    @Override
    protected void onPause() {
        super.onPause();
        Log.d(TAG, "onResume ***********************************************************************");

    }

    // Nested 'listener'
    protected class MyListener extends BroadcastReceiver {

        @Override
        public void onReceive(Context context, Intent intent) {

            if (intent.getAction().equals(Consts.COM_CARLSBERG_INCOMINGSTATUS_ACTION_START)) {
                tabHost.setCurrentTab(0);
            }
            if (intent.getAction().equals(Consts.COM_CARLSBERG_OUTGOINGSTATUS_ACTION_START)) {
                tabHost.setCurrentTab(1);
            }           
        }
    }

}
  • 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-26T20:31:54+00:00Added an answer on May 26, 2026 at 8:31 pm

    An Activity is not a View. There is no onFinishInflate method in Activity. What is it that you need to do after the View you use in setContentView has inflated?

    I believe it is very bad practice to try to mess with views in a separate activity. See these links for an alternative way to share data between tabs

    • Sharing data between tabs
    • Passing ArrayList<String> between tabs
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this is a duplicate question. but i want know it with an
Hi friends i want know sectionIndexTitlesForTableView Action is works i have the following code...
I know this very regular question But i didn't get that's way ask here
I want to know how to make this circle between the 18 minutes ago
Want to know what the stackoverflow community feels about the various free and non-free
want to know why String behaves like value type while using ==. String s1
I want to know what a virtual base class is and what it means.
I want to know what are the options to do some scripting jobs in
I want to know what exactly is the sequence of calls that occurs when
I want to know which tool can be used to measure the cyclomatic complexity

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.