Thanks Dianne.

But then what is the use of the FLAG mentioned.

I'm trying to do something like this. Can you let me know why it
doesn't work?

In TestActivity.java:
        IntentFilter iFilter = new IntentFilter();
        iFilter.addAction(Intent.ACTION_SCREEN_OFF);
        registerReceiver(new BroadcastReceiver() {
            public void onReceive(Context context, Intent intent)
            {
                Intent lockedIntent = new Intent();
                lockedIntent.setClassName("com.foo.Test",
"com.foo.Test.LockedScreenActivity");
                context.startActivity(lockedIntent);
            }
        }, iFilter);

In LockedScreenActivity.java:

public void onCreate(Bundle savedInstanceState)
    {
 
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
 
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
        setContentView(R.layout.locked);
    }

Thanks again for your help.

On Nov 23, 12:24 pm, Dianne Hackborn <[email protected]> wrote:
> Sorry this isn't supported by the SDK.  (There are hacks that people use to
> do this kind of stuff, but they are fragile and likely to break in newer
> platform versions.)
>
>
>
>
>
>
>
>
>
> On Tue, Nov 23, 2010 at 9:17 AM, Tejas <[email protected]> wrote:
> > Hi,
>
> > I want to put out a message from my application on locked screen.
> > Something like, If Found please call <number>
>
> > Is there a way to do it ?
> > I see there is a FLAG_SHOW_WHEN_LOCKED flag using which I assume it
> > can be done.
> > Can anyone provide some example ?
>
> > Regards,
> > Tej
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]<android-developers%2Bunsubs 
> > [email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Dianne Hackborn
> Android framework engineer
> [email protected]
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to