You cannot disable the home button via SDK. See
http://www.mail-archive.com/android-developers@googlegroups.com/msg52244.html

On Aug 13, 9:19 am, 李实 <lishi1...@gmail.com> wrote:
> thank you for help,but you may mistake me.
> what I really want to do is to disable the home key,when my activity
> is running .
> and the code in the  xml is my attempt.
> when home is pressed,then android probably sent an intent "home".
> in my activity,android find it has "HOME" category,so it does
> nothing,so the home key is "disabled" .
> As i wrote,it works in AVD but not in a SAMSUMG phone.
>
> I wonder if there is other way to kick the goal.
>
> 2010/8/12 Mathias Lin <m...@mathiaslin.com>
>
>
>
>
>
> > I do the same on a Samsung Galaxy S with 2.1update1 and 2.2 without a
> > problem. The approach you described is correct.
> > My intent filter looks similar:
>
> >             <intent-filter>
> >                <action android:name="android.intent.action.MAIN"/>
> >                <category
> > android:name="android.intent.category.LAUNCHER"/>
> >                <category android:name="android.intent.category.HOME"/
>
> >                <category
> > android:name="android.intent.category.DEFAULT"/>
> >            </intent-filter>
>
> > When you press the home button first, you should get a dialog where to
> > choose the home application to use, which is where the user can
> > optionally tick a checkbox to set the selected app as the default home
> > screen, so that the dialog won't show again.
> > So, this dialog only comes up on the emulator but never appeared on
> > your real phone?
>
> > On Aug 8, 12:47 pm, ʵ <lishi1...@gmail.com> wrote:
> > > I'm working on a slide-unlock program and I want it take the place of
> > > Android KeyguardLock.
>
> > > there is one last thing todo.it's the home key.
>
> > > I google it and found we cannnot handle it as the other keys with
> > > "onkeydown","dispatchkeyevent" method.
>
> > > so I add this
> > > <action android:name="android.intent.action.MAIN" />
> > > <category android:name="android.intent.category.HOME" />
> > > <category android:name="android.intent.category.DEFAULT" />
> > > to activity.
>
> > > It does works on AVD!
> > > I think Android receive "home" intent when home key is pressed ,then
> > > it try to find someone to handle the intent.it found two can handle
> > > this.And one of the two happens to my program and my program is on.so
> > > it send the intent to my program .So,the home key is disabled when my
> > > program is running.
>
> > > But,it does not work on a samsung true phone!!
> > > what can I do,is there any other way to make it??
>
> > > thanks!
> > > Simon Lee
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> execuse me for my poor English

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

Reply via email to