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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:04:28+00:00 2026-05-31T23:04:28+00:00

hi I’m trying to load up a html file via a Custom Alert box,

  • 0

hi I’m trying to load up a html file via a Custom Alert box, to take advantage of formatting. but my app crashes when ever I launch the dialog. I had a problem yesterday too when I was just using html string conversion, I could get things like bold text working, but couldn’t encourage it to use an image file located in my root/assets folder. I wonder if its a code error or am I referencing my assets folder incorrectly. I know it sounds like two problems but I’m hoping they are related?

I’ve tried with and without the JS true, there is no js in my html file, and its very basic.

     WebView mWebView = (WebView) findViewById(R.id.webView);
     mWebView.getSettings().setJavaScriptEnabled(true);
     mWebView.loadUrl("file:///android_asset/helppage.html");

Error Dump

 03-24 14:20:59.800: W/dalvikvm(5574): threadid=1: thread exiting with uncaught exception (group=0x4001e578)
03-24 14:20:59.800: E/AndroidRuntime(5574): FATAL EXCEPTION: main
03-24 14:20:59.800: E/AndroidRuntime(5574): java.lang.NullPointerException
03-24 14:20:59.800: E/AndroidRuntime(5574):     at com.mediabar.timelapse.TimeLapseActivity.createDialog(TimeLapseActivity.java:140)
03-24 14:20:59.800: E/AndroidRuntime(5574):     at com.mediabar.timelapse.TimeLapseActivity$3.onClick(TimeLapseActivity.java:66)
03-24 14:20:59.800: E/AndroidRuntime(5574):     at android.view.View.performClick(View.java:2538)
03-24 14:20:59.800: E/AndroidRuntime(5574):     at android.view.View$PerformClick.run(View.java:9152)
03-24 14:20:59.800: E/AndroidRuntime(5574):     at android.os.Handler.handleCallback(Handler.java:587)
03-24 14:20:59.800: E/AndroidRuntime(5574):     at android.os.Handler.dispatchMessage(Handler.java:92)
03-24 14:20:59.800: E/AndroidRuntime(5574):     at android.os.Looper.loop(Looper.java:130)
03-24 14:20:59.800: E/AndroidRuntime(5574):     at android.app.ActivityThread.main(ActivityThread.java:3691)
03-24 14:20:59.800: E/AndroidRuntime(5574):     at java.lang.reflect.Method.invokeNative(Native Method)
03-24 14:20:59.800: E/AndroidRuntime(5574):     at java.lang.reflect.Method.invoke(Method.java:507)
03-24 14:20:59.800: E/AndroidRuntime(5574):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
03-24 14:20:59.800: E/AndroidRuntime(5574):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
03-24 14:20:59.800: E/AndroidRuntime(5574):     at dalvik.system.NativeStart.main(Native Method)

EDIT: Added activity

public class mainActivity extends Activity {

   @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        overridePendingTransition(R.anim.pull_left_in, R.anim.push_right_out);
        setContentView(R.layout.main);

        Button help = (Button) findViewById(R.id.help);
        help.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                createDialog();
            }

        });     
    }

    public void createDialog() {

         final Dialog dialog = new Dialog(CopyOfTimeLapseActivitybackup.this);

         dialog.setContentView(R.layout.help_dialog);
         dialog.setTitle("Help Area");

         WebView mWebView = (WebView) findViewById(R.id.webView);
         mWebView.loadUrl("file:///android_asset/helppage.html");

         Button button = (Button) dialog.findViewById(R.id.okButton);
         button.setOnClickListener(new OnClickListener() {
             @Override
             public void onClick(View v) {

                   dialog.dismiss();
             }
         });

         dialog.show(); 
    }

}
  • 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-31T23:04:29+00:00Added an answer on May 31, 2026 at 11:04 pm

    Change this line:

    WebView mWebView = (WebView) findViewById(R.id.webView);
    

    to look like this:

    WebView mWebView = (WebView) dialog.findViewById(R.id.webView);
    

    You have to do it this way because your webview’s parent is the dialog, not your Activity layout.

    I think you might also have to move all of your findViewById() calls to after the dialog.show();

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to render a haml file in a javascript response like so:
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.