Hi i try native interface  but somewhere is a problem

when is send to android build i got error
/tmp/build7814121818795036965xxx/TalkingGps/src/main/java/com/Bellproductions/TalkingGps/BrightImpl.java:27:
 
error: cannot find symbol
  cResolver  = getContext().getContentResolver();
               ^
  symbol:   method getContext()
  location: class BrightImpl


the code is 
package com.Bellproductions.TalkingGps;

import android.app.Activity;
import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException;
import android.view.WindowManager;
import android.view.Window;
import android.content.ContentResolver;
import android.content.Context;

public class BrightImpl {
    
    private ContentResolver cResolver;
    private Context context;
    public void brightset(int brightness ) {
  
        
        try {

 //constrain the value of brightness
    if(brightness < 0)
        brightness = 0;
    else if(brightness > 255)
        brightness = 255;


  cResolver  = getContext().getContentResolver();

    Settings.System.putInt(cResolver, Settings.System.SCREEN_BRIGHTNESS, 
brightness);

 
 } catch (Exception e) {}
        
    }

    public boolean isSupported() {
        return false;
    }

}


>>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/bcf27c76-280a-40e6-ba0e-0412cc139ded%40googlegroups.com.

Reply via email to