Android Question Inline Java

Discussion in 'Android Questions' started by ykucuk, Jul 31, 2015.

  1. ykucuk

    ykucuk Active Member Licensed User

    Hello,

    i am trying work with AdditionalJar

    everyhing is fine until write below code to inside

    #If JAVA

    import android.app.enterprise.license.EnterpriseLicenseManager;


    end if


    mContext = this.getApplicationContext();
    mLicenseMgr = EnterpriseLicenseManager.getInstance(mContext);
    String key = "XXXXXXXXX" ;
    mLicenseMgr.activateLicense(key);

    i got error :


    javac 1.7.0_65
    src\b4a\example\main.java:492: error: cannot find symbol
    mContext = this.getApplicationContext();
    ^
    symbol: variable mContext
    location: class main
    1 error


    i am sure there is something about java syntax or something else

    can anyone help me about write exact code to inside Inline Java

    best regards
     
  2. Enrique Gonzalez R

    Enrique Gonzalez R Well-Known Member Licensed User

    the end if should begin with # too...
     
  3. ykucuk

    ykucuk Active Member Licensed User

    there is # before end if. i just didnt copy as well . it s not solution for my problem
     
  4. Enrique Gonzalez R

    Enrique Gonzalez R Well-Known Member Licensed User

    well after that, the cannot find symbol and the compiler stating that the problem is the word "mContext", either you forgot the declare it, or if you declare it elsewhere it is private.
     
  5. ykucuk

    ykucuk Active Member Licensed User

    how can i declare mcontext in this java code. i am not familiar with java
     
  6. warwound

    warwound Expert Licensed User

    Try:

    Code:
    Context mContext = this.getApplicationContext();
     
  7. ykucuk

    ykucuk Active Member Licensed User

    same error

    javac 1.7.0_65
    src\b4a\example\main.java:490: error: cannot find symbol
    Context mContext = this.getApplicationContext();
    ^
    symbol: class Context
    location: class main
    1 error
     
  8. warwound

    warwound Expert Licensed User

    Try adding an import for the Context class:

    Code:
    import android.content.Context;
     
Loading...
  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