Android Question Moverio Glasses - How to set window (activity) layout parameters?

Discussion in 'Android Questions' started by Rick in North Carolina, Jun 11, 2015.

  1. Rick in North Carolina

    Rick in North Carolina Member Licensed User

    Forgive me if this has been answered (i searched the forum for anything close...)

    I am using Epson Moverio Glasses and it has an unconventional way of setting the activity to full screen (I tried the conventional Android ways...manifest , etc.. )

    From Epson's docs for Android:
    Application can use full screen with the following setting.
    FLAG_SMARTFULLSCREEN = 0x80000000;
    Implement the following lines in each Activity onCreate():


    Window win = getWindow();
    WindowManager.LayoutParams winParams = win.getAttributes();
    winParams.flags |= WindowManager.LayoutParams.FLAG_SMARTFULLSCREEN;
    win.setAttributes(winParams);

    This is as far as I have gotten with B4A...

    Dim rWin As Reflector
    rWin.Target = rWin.GetActivity
    Dim Window As JavaObject = rWin.RunMethod("getWindow")

    Some direction to continue would be appreciated :cool:
    Thanks!
     
  2. DonManfred

    DonManfred Expert Licensed User

    I would try to use inline java; see the turorial on how to extend onCreate
     
  3. Rick in North Carolina

    Rick in North Carolina Member Licensed User

    Ahhh yes... perfect! Thanks Manfred.

    Here is the java code added to the bottom of my application code:

    Code:
    application code........
            ImageBlue.Visible = 
    False
            
    ToastMessageShow("End Connection"True)
            
    Log("End Connection")
    End Sub

    Code:
    #If JAVA
    import android.view.Window;
    import android.view.WindowManager;

    public void _onCreate() {
          long FLAG_SMARTFULLSCREEN = 0x80000000;
          Window win = getWindow();
          WindowManager.LayoutParams winParams = win.getAttributes();
          winParams.flags |= FLAG_SMARTFULLSCREEN;
          win.setAttributes(winParams);
    }
    public void _onResume() {
         BA.Log("_onResume");
    }
    public void _onPause() {
         BA.Log("_onPause");
    }
    public void _onDestroy() {
         BA.Log("_onDestroy");
    }
    public void _onStop() {
         BA.Log("_onStop");
    }
    public void _onStart() {
         BA.Log("_onStart");
    }
    #End IF
     
    Last edited: Jun 12, 2015
Loading...