1

Kindle fire has a grey toolbar at the bottom of the screen with the Home soft button and some other buttons, as well as a toolbar to get to settings and such on top. I am building an app which will be the only app running on that particular Kindle for a niche business. Is there a way to disable either or both of these soft key toolbars?

Thanks.

Sid
  • 7,511
  • 2
  • 28
  • 41

2 Answers2

0

No, it's not possible disable the soft key menu. You can take a look at the Kindle Fire documentation but there's no information :(

But, If you want, you can disable the home button and the back button of the soft key menu:

@Override
public void onAttachedToWindow()
{  
    //Disable home button
    this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);     
    super.onAttachedToWindow();  
}

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    //Disable all keys
    return false;
}

[UPDATE]

And you must update your manifest with:

        <intent-filter>
            ...
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.HOME" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

Then, when you press the home button from the top menu, you'll get a list dialog, enable the "Use by default for this action" checkbox and select you app.

gergonzalez
  • 2,488
  • 1
  • 22
  • 21
  • I tried this but it didn't work. When I press the Home button LogCat shows: 02-28 21:43:01.848: I/ActivityManager(1373): Displayed android/com.android.internal.app.ResolverActivity: +251ms onAttachedToWindow() doesn't get called (I have some LogCat trace in there that never gets displayed). – Sid Feb 29 '12 at 02:44
  • Disabling the Home button will actually take me one step closer...so any help is appreciated. – Sid Feb 29 '12 at 02:44
  • Sorry for the delay... I've been testing in a KF and it works for me, **if you override those two methods in your main activity**. You can easily try it, you just create a new project, override those two methods in your main activity and run it. – gergonzalez Mar 03 '12 at 11:47
  • It does disable the home button on the bottom bar initially but when you bring up the bottom menubar then brng down the top menubar (settings bar) and then push the home button on the bottom menubar, the home button now functions. So it's as if it gets disabled and re-enabled. Any explanation for this? – Sid Mar 05 '12 at 02:27
  • Yep, you're right :(. I don't test this case. The problem is this home button don't belong to your application... Even that, I've updated my first answer with a possible half-solution. I hope it helps you :) – gergonzalez Mar 05 '12 at 08:48
  • Thanks for all your replies. I currently have this setup and seems like this is the closest it is possible to get to what I want to achieve. I will mark your answer as correct as this seems to be the only way. – Sid Mar 05 '12 at 13:22
  • There are some apps that do not show the search icon on every activity. How is this done? – Code Droid Jun 08 '12 at 23:49
0

You can hide both the toolbar by setting the app to run on fullscreen.

animuson
  • 53,861
  • 28
  • 137
  • 147