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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:19:08+00:00 2026-05-24T20:19:08+00:00

whet i am starting new Activity using this way below Intent edit = new

  • 0

whet i am starting new Activity using this way below

Intent edit = new Intent(getParent(), WebViewLink.class);
TabGroupActivity parentActivity = (TabGroupActivity) getParent();
edit.putExtra(POSITION, FAQ);
parentActivity.startChildActivity("WebViewLink", edit);

I am getting error like this

08-19 13:44:49.955: ERROR/AndroidRuntime(548): Uncaught handler: thread main exiting due to uncaught exception
08-19 13:44:49.974: ERROR/AndroidRuntime(548): android.view.WindowManager$BadTokenException: Unable to add window -- token android.app.LocalActivityManager$LocalActivityRecord@44dabdc8 is not valid; is your activity running?
08-19 13:44:49.974: ERROR/AndroidRuntime(548):     at android.view.ViewRoot.setView(ViewRoot.java:468)
08-19 13:44:49.974: ERROR/AndroidRuntime(548):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)
08-19 13:44:49.974: ERROR/AndroidRuntime(548):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
08-19 13:44:49.974: ERROR/AndroidRuntime(548):     at android.view.Window$LocalWindowManager.addView(Window.java:424)
08-19 13:44:49.974: ERROR/AndroidRuntime(548):     at android.app.Dialog.show(Dialog.java:239)
08-19 13:44:49.974: ERROR/AndroidRuntime(548):     at com.stress.WebViewLink$2.onLoadResource(WebViewLink.java:73)
08-19 13:44:49.974: ERROR/AndroidRuntime(548):     at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:355)
08-19 13:44:49.974: ERROR/AndroidRuntime(548):     at android.os.Handler.dispatchMessage(Handler.java:99)
08-19 13:44:49.974: ERROR/AndroidRuntime(548):     at android.os.Looper.loop(Looper.java:123)
08-19 13:44:49.974: ERROR/AndroidRuntime(548):     at android.app.ActivityThread.main(ActivityThread.java:4363)
08-19 13:44:49.974: ERROR/AndroidRuntime(548):     at java.lang.reflect.Method.invokeNative(Native Method)
08-19 13:44:49.974: ERROR/AndroidRuntime(548):     at java.lang.reflect.Method.invoke(Method.java:521)
08-19 13:44:49.974: ERROR/AndroidRuntime(548):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
08-19 13:44:49.974: ERROR/AndroidRuntime(548):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
08-19 13:44:49.974: ERROR/AndroidRuntime(548):     at dalvik.system.NativeStart.main(Native Method)

but when I am using this way for call new Activity There is no problem

Intent edit = new Intent(getParent(), WebViewLink.class);
edit.putExtra(POSITION, FAQ);
More.this.startActivity(edit);

you can see My WebViewLink.java class here

public class WebViewLink extends Activity {
public static String POSITION = "position";
int position = 0;
private Button back;
private TextView ttl;
ProgressDialog myProgressDialog = null;
private WebView webView;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.webview);

    webView = (WebView) findViewById(R.id.webview);
    back = (Button) findViewById(R.id.backtomore);
    ttl = (TextView) findViewById(R.id.my_title);
    webView.getSettings().setJavaScriptEnabled(true);
    if (getIntent().getExtras() != null) {
        if (getIntent().getExtras().containsKey(POSITION)) {
            position = getIntent().getExtras().getInt(POSITION);
        }
    }
    switch (position) {
    case More.FAQ:
        ttl.setText("FAQ");
        setWebLink();
        webView.loadUrl("file:///android_asset/faq4.htm");
        break;
    case More.ABOUT_US:
        ttl.setText("About Us");
        setWebLink();
        webView.loadUrl("file:///android_asset/Advice/About Us.html");
        break;
    case More.DISCLAIMMER:
        ttl.setText("Disclaimer");
        setWebLink();
        webView.loadUrl("file:///android_asset/Advice/Disclaimer.html");
        break;
    }
    back.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            finish();
        }
    });
}

private void setWebLink() {
    webView.setWebViewClient(new WebViewClient() {
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            view.loadUrl(url);
            return true;
        }
        public void onLoadResource(WebView view, String url) {
            if (myProgressDialog == null) {
                myProgressDialog = new ProgressDialog(WebViewLink.this);
                myProgressDialog.setMessage("Loading.... Please Wait");
                myProgressDialog.show();
            }
        }
        public void onPageFinished(WebView view, String url) {
            if (myProgressDialog.isShowing()) {
                myProgressDialog.dismiss();
            }
        }
    });
}

}

  • 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-24T20:19:08+00:00Added an answer on May 24, 2026 at 8:19 pm

    The problem is in this line of code:

    myProgressDialog = new ProgressDialog(WebViewLink.this);
    

    when you are you TabGroupActivity then child Activity(ies) need parents’ Context to add new Windows, Dialogs. Try this way:

    myProgressDialog = new ProgressDialog(WebViewLink.this.getParent());
    

    and do the same for all Dialogs.

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

Sidebar

Related Questions

This is a design question, to whet the guru's appetite. In a previous version,
I am trying to add calendar event using the below code in my android
Whet I need to do is in my menu I would like to add
I am using the following code to accept payments for digital goods: https://www.x.com/blogs/Nate/2011/01/07/digital-goods-with-express-checkout-in-php I
Whet are things to look for when trying to optimize a mysql query that
I've asked a question about changing the version of .Net sites in the IIS.
I have a small problem with jQuery $.ajax() function. I have a form where
The code #!/usr/bin/env python import MySQLdb print Content-Type: text/html print print <html><head><title>Books</title></head> print <body>
When i set to some view weight or height in dpi on others screen
I just installed Casandra on my windows machine. When I run cassandra.bat everything seems

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.