开发者

Android: WebView ActionBar (Honeycomb)?

开发者 https://www.devze.com 2023-03-31 05:28 出处:网络
I have MyActivity with WebView element. When I \"long press\" on web view the ActionBar pops up. If I try to access the action bar like

I have MyActivity with WebView element. When I "long press" on web view the ActionBar pops up. If I try to access the action bar like

getActionBar()

somewhere inside my activity I get null. It seems the web view is using some kind of menu popup.

QUESTIONS:

    开发者_开发问答
  1. How can I access that action bar?
  2. How to set the action bar not to move the activity down when it is displayed (so ActionBar to be on top of it > position:absolute)?

Android: WebView ActionBar (Honeycomb)?


This is called an ActionMode. You can make it overlay your Activity by setting android:windowActionModeOverlay="true" in your theme, like setting android:windowActionBarOverlay to have the ActionBar overlay content.

There is an ActionMode hook in Activity which you can maybe use: onActionModeStarted().

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号