0

I am developing a lock screen in my application and i have the same problem as given in the following link How to disable Home button without using the TYPE_KEYGUARD?. I have used

public void onAttachedToWindow()
{  
    this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);     
    super.onAttachedToWindow();  
}

and added android:theme="@android:style/Theme.NoTitleBar.Fullscreen" in my mainfest.xml file. but still it is not working.

part of my mainfest.xml

<activity android:name=".LockActivity"  android:windowSoftInputMode ="stateAlwaysHidden"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen">

    </activity>

more details about my appliation is

my applications works in background and as i get the command my lock activity is displayed. but the problem is when i turn off my screen from power button and the command comes after that when i unlock the screen then either status bar appears or i cannot block my home button.

Community
  • 1
  • 1
sagar
  • 153
  • 1
  • 8

2 Answers2

0
private void hideSystemUI() {

    View decorView = getWindow().getDecorView();
    decorView.setSystemUiVisibility(
            View.SYSTEM_UI_FLAG_IMMERSIVE

                    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                    | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                    | View.SYSTEM_UI_FLAG_FULLSCREEN);
}
Mohamed Salman
  • 309
  • 2
  • 9
-1

it is working 2.2

<activity android:label="@string/app_name"  android:name=".Small"  
          android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/> 
NagarjunaReddy
  • 8,621
  • 10
  • 63
  • 98
  • my applications works in background and as i get the command my lock activity is displayed. but the problem is when i turn off my screen from power button and the command comes after that when i unlock the screen then either status bar appears or i cannot block my home button. – sagar Feb 06 '12 at 12:30
  • but i am not able to do it.please can you tell me more on yours application. – sagar Feb 06 '12 at 13:20
  • android:windowSoftInputMode why use this in place use android:label – NagarjunaReddy Feb 06 '12 at 13:22
  • my full screen works if their is no default screen guard on. but the problem is when the screen guard is on and the my activity sren has to appear. – sagar Feb 06 '12 at 13:25
  • i have tried in android 2.2 still not working and i have even removed android:windowSoftInputMode but still not working. – sagar Feb 07 '12 at 10:16
  • i want an screen lock application which works even when the screen is off, this screen lock must get invoked when command comes via sms,to lock the phone. – sagar Feb 07 '12 at 12:29
  • my application is first you start app enter password and confine password in that....... and up some time anybody not touch that auto matically sereen is off. again we start appenter same password.this my app – NagarjunaReddy Feb 07 '12 at 12:37
  • ok but i want my application to get invoked externally only via sms.so if the sms comes and the screen is off then tats where my issue is. – sagar Feb 07 '12 at 13:00