Android Question Java Code Error

Discussion in 'Android Questions' started by Marcos Alves, Feb 17, 2019.

  1. Marcos Alves

    Marcos Alves Active Member Licensed User


    I'm trying to compile an app with the code:
    #If Java

        public static String toHtml(TextView sourceText) {
            String returnString = Html.toHtml(sourceText);
            return returnString;
        public static TextView fromHtml(String htmlString) {
             TextView returnView = Html.fromHtml(htmlString);
            return returnView;
    #End If
    But getting the error:

    src\com\texttest\ error: cannot find symbol
    public static String toHtml(TextView sourceText) {
    symbol: class TextView
    location: class main

    What's wrong? I really don't have practice to build java code in B4A... could anybody help?

  2. JohnK

    JohnK Active Member Licensed User

    just a guess, but maybe the import is missing?

    import android.text.Html;
    Marcos Alves likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice