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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:26:07+00:00 2026-05-23T05:26:07+00:00

Edit: Error: 06-12 19:25:55.880: ERROR/AndroidRuntime(226): Uncaught handler: thread main exiting due to uncaught exception

  • 0

Edit:

Error:

06-12 19:25:55.880: ERROR/AndroidRuntime(226): Uncaught handler: thread main exiting due to uncaught exception
06-12 19:25:55.910: ERROR/AndroidRuntime(226): java.lang.NullPointerException
06-12 19:25:55.910: ERROR/AndroidRuntime(226):     at com.laytproducts.songmaster.mainAct$1.onClick(mainAct.java:124)
06-12 19:25:55.910: ERROR/AndroidRuntime(226):     at android.view.View.performClick(View.java:2364)
06-12 19:25:55.910: ERROR/AndroidRuntime(226):     at android.view.View.onTouchEvent(View.java:4179)
06-12 19:25:55.910: ERROR/AndroidRuntime(226):     at android.widget.TextView.onTouchEvent(TextView.java:6541)
06-12 19:25:55.910: ERROR/AndroidRuntime(226):     at android.view.View.dispatchTouchEvent(View.java:3709)
06-12 19:25:55.910: ERROR/AndroidRuntime(226):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
06-12 19:25:55.910: ERROR/AndroidRuntime(226):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
06-12 19:25:55.910: ERROR/AndroidRuntime(226):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
06-12 19:25:55.910: ERROR/AndroidRuntime(226):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
....

code:

rawHtml = getHtml(baseSite + rSearched); //get the raw html of page
if(rawHtml == null || rawHtml.length() < 1){//checks if it really contains anything
    Toast.makeText(getApplicationContext(), "Error: Got No Result", Toast.LENGTH_SHORT).show();
    Log.e("RawHtml Error:1", "Nothing In rawHtml String");
} else {
    for(int i = 1; i < 7; i++){
        String html = parseHtml(rawHtml,i);
        if(html == null || html.length() < 1){
            results[i-1] = "Result not found:Please try different lyrics";
        } else {
            results[i-1] = parseHtml(rawHtml,i); //error here
        }
    }
}

parseHtml:

public String parseHtml(String html,int num){
    String parsed = "";
    String artistParse = "";
    String songParse = "";
    //String fullHtmlParse = "#NUMBER#. &nbsp;<span>This Charming Man</span> &nbsp; by Smiths</a>";//Reference
    if(num != 0 && num <= 6){
        songParse = StringUtils.substringBetween(html,num+". &nbsp;<span>","</span>");
        artistParse = StringUtils.substringBetween(html,num+". &nbsp;<span>"+songParse+"</span> &nbsp; by ","</a>");
    } else {
        Toast.makeText(getApplicationContext(),
                "Error: Number is wrong in parseHtml, Please Try Again.", Toast.LENGTH_SHORT).show();
        Log.e("ParsedHtml Error:1","Error: Number in parseHtml is invalid: " + num);
        return "";
    }
    parsed = songParse + ":" + artistParse;
    return parsed;
}

getHtml:

public String getHtml(String url){
    String html = "";
    String baseHtml = "";
    String table = "";
    try {
        baseHtml = new StringReader(url).toString();
    } catch (Exception e) {
        Toast.makeText(getApplicationContext(), "Error getting HtmlDoc, Please Try Again.", Toast.LENGTH_SHORT).show();
        e.printStackTrace();
        return "";
    }
    if(baseHtml == null || baseHtml.length() < 1){
        Toast.makeText(getApplicationContext(), "Error getting HtmlDoc, Please Try Again.", Toast.LENGTH_SHORT).show();
        Log.e("BaseHtml Error:1","Error: Nothing in baseHtml[method getHtml(String url)]");
        return "";
    } else {
        //table = StringUtils.substringBetween(baseHtml,"<!-- EyesLyrics.com search results -->","</table>");
    }
    html = baseHtml;
    return html;
}

Hope that is what you need.

  • 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-23T05:26:08+00:00Added an answer on May 23, 2026 at 5:26 am

    To make the Toast appear, you’ll need to call the show()-method. Like this:

    Toast.makeText(getApplicationContext(), "Error getting HtmlDoc, Please Try Again.", Toast.LENGTH_SHORT).show();
    

    See here for more details.


    if(rawHtml == "" || rawHtml == null){[...]}
    

    I guess the rawHtml-object is a String? In that case, if you want to check if this String is empty, you would neither use the equals("")-method or check for the String’s length:

    if (rawHtml.length < 1)
    

    Also, if you need to check if the String is null, you should do that first, because the check for the length (for example) would cause a NullPointerException.


    About your code

    if(rawHtml == null ...
    

    Testing if rawHtml is null is unnecessary, because in the getHtml-method, you crate it as an empty String. It will never be null.

    return "";
    

    You return an empty String in your parseHtml and getHtml-methods. I would rather return null and then check if the returned value is null. You can spare one condition with the same effect.

    results[i-1] = "...";
    

    The calculation should be done in brackets, like this:

    results[(i-1)] = "...";
    

    Your error aperas to be on this line:

    results[i-1] = parseHtml(rawHtml,i);
    

    As I can’t see if you initialize the results-object, I guess this is your problem. Before you can access (write or read) an element in this array, the array needs to be initialized.

    This is how you would do this, guessing your array is a String-array:

    String[] results = new String[NumberOfElements];
    

    I hope this solves your problem.

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

Sidebar

Related Questions

I am getting the following error when an event (Add/Edit/Delete) occurs on my databound
[Edit] I've summarized the answer to the following below, the error lies in the
I am getting a StackOverflow Error in this code: EDIT [XmlAttribute(ID)] public string ID
Edit: Answered - error was method wasn't static I'm used the Singleton Design Pattern
EDIT: new error: Error Jquery not defined line: 208 Line 208 in this code:
Edit: This question was written in 2008, which was like 3 internet ages ago.
Edit: From another question I provided an answer that has links to a lot
EDIT: This was formerly more explicitly titled: - Best solution to stop Kontiki's KHOST.EXE
EDIT: Learned that Webmethods actually uses NLST, not LIST, if that matters Our business
EDIT: This question is more about language engineering than C++ itself. I used C++

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.