Is it possible to click (with AccessibilityService) specific buttons that are placed inside Webview? E.g some application A has a webview inside MainActivity. After activity started web content is loaded in webview. Loaded web page contains button with text "Chat". Can I click this button with Accessibility Service? I know I can perform click on Android native widgets (android.widget.Button, TextView etc) but I don't know how to perform click on the button that displayed on web page inside web view. Please help :)
Related
I have some webview in my android app. So on click of a button inside webview, need to open a specific app screen using deeplink. How to do that?
create some custom JS interface and handle this click, how to HERE
another aproach would be to use custom WebViewClient set for WebView with overriden shouldOverrideUrlLoading method and inside of it apply your own logic for opening some other Activity or whatever, and then return true. if passed url should be loaded in WebView just return false
I am making a webview client app for my RSS website. The webview and splashscreen are working great in theme.notitlebar.fullscreen.
Because external links are opening in my webview, i want a back button in the titlebar. But i want to keep the full screen option, to remove the time and notifications, and the device buttons.
What i dont understand: Is it correct that the titlebar includes: the bar with time and notifications - bar with app name, back button and settings (extra) button - the device buttons (if available)?
If that is right. How can i add a new bar into the mainactivity with my webview client, with a back button in it.
I hope you understand my question.
You can use image view. set src to back icon. and finish(); activity on imageview click.
Having a APP that loads inside an Activity a ChromeWebClient loads a webpage. This web page have's multiples forms / applications inside it. The funcionality that I want to control is to avoid the keyboard to show unless a variable is set up to be showed. (This variable only changes given a certain user actions). This is what I have test with no luck:
Set up Listener to ChromeWebClient
Set up listener to mainLayout
Set up listener onConfigurationChanged
Tryed this SoftKeyboard open and close listener in an activity in Android?
In my activity I have webview and top of WebView there is a RelativeLayout which contains edittext and button. This RelativeLayout has to open/close when user touch on webview. The problem is that I can't detect where user touch in html content, for instance if user click the button in HTML , RelativeLayout shoudn't open but if user touch blank area in html then RelativeLayout will open. How can I detect user's touch is not in any touchable or clickable area in html content ?
HTML pages are not in my control so I couldn't build jafascriptinterface, I has to do in with Webview.
event.preventDefault();
if your menu uses a jquery function that toggles the areas visible..
ex. if you have an click function..
$(".menu-item").click(
function () {
event.preventDefault();
yourcodethattogglesmenu
}
);
Show your code first in the future, will help us understand and give a better answer.
If i understood you correctly, you want to show a native view (RelativeLayout) once a specific HTML element is clicked.
The only way to trigger JAVA code from HTML content is the JavascriptInterface. If you do not control the HTML stuff you are out.
Is it possible to make WebView (or any view that can parse / display html) a "floating" window on top of the main layout?
Basically I have a list of links displayed in a listView. When the user select one of the link, i'd like to load and display the results in a floating panel (sorta like a context menu, but takes almost the entire screen and scrollable) with, say a close button on the top right corner. So when the user is done viewing the content, he/she can simply click the close button to return to the previous list page.
Is this possible? or I should start a new activity that loads a separate layout for the content, with some tracking mechanism to go back the list page.
Thanks much.
What I did for the help section of my application was to create a new Activity which just contains a WebView with the Theme.Dialog set in the AndroidManifest.xml:
<activity android:name=".HelpActivity" android:theme="#android:style/Theme.Dialog"/>
This way the WebView is launched as a 'floating dialog' on top of the current screen.
Not sure if this is exactly what you want, but it's a very simple and efficient way to accomplish what I needed to do.