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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:09:15+00:00 2026-06-01T04:09:15+00:00

I have a webview that I’m creating in an Activity which is a child

  • 0

I have a webview that I’m creating in an Activity which is a child of an Activity Group. The issue I’m having is that when I load an external weblink, the webview crashes when I click a link that would bring up a dialog:

03-28 12:06:24.189: E/AndroidRuntime(629): 
android.view.WindowManager$BadTokenException:
Unable to add window -- token 
android.app.LocalActivityManager$LocalActivityRecord@44ef7060 is not valid;
is your activity running?

So basically the issue I’m having, I think, is very similar to this question:

Webview crashes on select box or any Dialog

And the answer probably will work for me, the difference is that I’m declaring my webview from an xml file:

this.mainWebView = (WebView) findViewById(R.id.proxSearchWebView);

I’m still very new to Android Dev, so I’m assuming that declaring my webview in this way is setting the context to “this” , is there a way to set the context to getParent() while still using XML?

So basically, is there a way to make this work while still defining the webview through XML or do I have to programmatically create the webview entirely?

  • 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-01T04:09:17+00:00Added an answer on June 1, 2026 at 4:09 am

    android.view.WindowManager$BadTokenException: is basically due to context problem. Probably you are using the context of the current activity for create your dialog. You should use the parent activity context for create a dialog when you are using the Activity group.

    You can get parent activity context by calling getParent().

    Here is the link that you can refer for the same issue

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

Sidebar

Related Questions

I have various pieces of generated HTML/JS that I load into Activity with WebView#loadDataWithBaseURL.
I have Activity with some data displayed in WebView that I load with WebView#loadDataWithBaseURL
I have an issue that looks like a race condition with a webview callback
I have a WebView that I need to ask to load a website from
I have a webview and an string that holds over 500kb which displays the
I have a WebView that I've added to a view group: webView = new
I have a webview that's supposed to show cyrillic text wv.loadData( myStringHtml, html/text, utf-8);
I have a webview that shows some animated boxes, but it slows down and
I have a NSWindow that hosts a WebView that Ive hooked up to a
I am using a webview and on that web view i have a image.

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.