<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Screen lock (keyguard) not always working in XPERIA archive</title>
    <link>https://community.sony.com.mk/t5/xperia-archive/screen-lock-keyguard-not-always-working/m-p/3025252#M228100</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I use the clock application (the one that shows 4 icons on the bottom of the screen: alarm settings, pictures, music, home screen) the screen lock button will only blank the screen. Pressing it again will bring back the clock application. I guess that this is done on purpose, so that the phone can be used as a clock, so that you can quickly check the time when you wake up in the middle of the night.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I make a phone call, hang up and push the screen lock button, there seems to be a bug. When I push the button again, I will not get the lock screen nor the phone application screen, but the home screen! This could lead to ‘pocket calls’. Only after pressing the screen lock button a third time will the lock screen be activated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally, a programming question (sorry, maybe a bit off-topic here). I am thinking of developing my own ANT+Sport based bicycle computer application. (Sorry Ifor, while IpBike looks interesting, I prefer open source.) I would have the phone in the SportyPal mount on the handlebars. To save battery time, I would keep the screen blanked most of the time. But, when I hit the screen lock button, I would like to see my application screen with all the relevant data, instead of having to unlock the phone first. How can this be achieved? Is it by using the &lt;CODE&gt;&lt;A href="http://developer.android.com/reference/android/Manifest.permission.html#DISABLE_KEYGUARD" rel="nofollow noopener noreferrer"&gt;DISABLE_KEYGUARD&lt;/A&gt;&lt;/CODE&gt; permission and the deprecated &lt;A href="http://developer.android.com/reference/android/app/KeyguardManager.KeyguardLock.html" rel="nofollow noopener noreferrer"&gt;android.app.KeyguardManager.KeyguardLock&lt;/A&gt; methods, or by simply using the window attribute &lt;CODE&gt;&lt;A href="http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_DISMISS_KEYGUARD" rel="nofollow noopener noreferrer"&gt;FLAG_DISMISS_KEYGUARD&lt;/A&gt;&lt;/CODE&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Feb 2013 17:59:12 GMT</pubDate>
    <dc:creator>skela</dc:creator>
    <dc:date>2013-02-27T17:59:12Z</dc:date>
    <item>
      <title>Screen lock (keyguard) not always working</title>
      <link>https://community.sony.com.mk/t5/xperia-archive/screen-lock-keyguard-not-always-working/m-p/3025252#M228100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I use the clock application (the one that shows 4 icons on the bottom of the screen: alarm settings, pictures, music, home screen) the screen lock button will only blank the screen. Pressing it again will bring back the clock application. I guess that this is done on purpose, so that the phone can be used as a clock, so that you can quickly check the time when you wake up in the middle of the night.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I make a phone call, hang up and push the screen lock button, there seems to be a bug. When I push the button again, I will not get the lock screen nor the phone application screen, but the home screen! This could lead to ‘pocket calls’. Only after pressing the screen lock button a third time will the lock screen be activated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally, a programming question (sorry, maybe a bit off-topic here). I am thinking of developing my own ANT+Sport based bicycle computer application. (Sorry Ifor, while IpBike looks interesting, I prefer open source.) I would have the phone in the SportyPal mount on the handlebars. To save battery time, I would keep the screen blanked most of the time. But, when I hit the screen lock button, I would like to see my application screen with all the relevant data, instead of having to unlock the phone first. How can this be achieved? Is it by using the &lt;CODE&gt;&lt;A href="http://developer.android.com/reference/android/Manifest.permission.html#DISABLE_KEYGUARD" rel="nofollow noopener noreferrer"&gt;DISABLE_KEYGUARD&lt;/A&gt;&lt;/CODE&gt; permission and the deprecated &lt;A href="http://developer.android.com/reference/android/app/KeyguardManager.KeyguardLock.html" rel="nofollow noopener noreferrer"&gt;android.app.KeyguardManager.KeyguardLock&lt;/A&gt; methods, or by simply using the window attribute &lt;CODE&gt;&lt;A href="http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_DISMISS_KEYGUARD" rel="nofollow noopener noreferrer"&gt;FLAG_DISMISS_KEYGUARD&lt;/A&gt;&lt;/CODE&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Feb 2013 17:59:12 GMT</pubDate>
      <guid>https://community.sony.com.mk/t5/xperia-archive/screen-lock-keyguard-not-always-working/m-p/3025252#M228100</guid>
      <dc:creator>skela</dc:creator>
      <dc:date>2013-02-27T17:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: Screen lock (keyguard) not always working</title>
      <link>https://community.sony.com.mk/t5/xperia-archive/screen-lock-keyguard-not-always-working/m-p/3025253#M228101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The solution to my programming question is to do the following in Activity.onCreate():&lt;/P&gt;&lt;P&gt;getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);&lt;/P&gt;&lt;P&gt;This does not seem to require any special permissions. The screen will go black when I push the power/lock button, and the application screen will come back when I push the power/lock button again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess that the dialer application is controlling this flag (or similar flag) dynamically, and the bug there is that it does not clear the flag immediately after you hang up a call (when the call information screen is visible), but only after it returns to the previous screen, such as the call log, from which the call was initiated. I was wrong in my initial post; it seems that the power/lock button will bring back the dialer application, not the home screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way, my firmware version 4.0.2.A.0.62 (Android 2.3.4).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Feb 2013 21:20:07 GMT</pubDate>
      <guid>https://community.sony.com.mk/t5/xperia-archive/screen-lock-keyguard-not-always-working/m-p/3025253#M228101</guid>
      <dc:creator>skela</dc:creator>
      <dc:date>2013-02-27T21:20:07Z</dc:date>
    </item>
  </channel>
</rss>

