Webview Custom Back Button - java

I need to make custom back button in WebView.
Its any way to get OnBackPress with custom button?
Just have a full screen webview, and i want to make button to going back in the webview.
Thanks.

Related

How to turn it off the snap button and ok button in camera by android studio?

I currently require to design a camera function for android version 4 (Kitkat), but i notice that there is snap picture button and ok button in the camera as picture below:
How to make it disappear and user just touch on screen it can snap the picture without the button, and the picture will directly save without need of pressing ok button.
Anyone can share me the ideas, I very need you guys help because suffer this for long time already, thanks.

Android Studio viewFlipper Crashing App

I'm making an application. I have succeeded in creating a viewFlipper with:
android:flipInterval="5000"
android:autoStart="true"
I've also made two buttons, next and previous, with:
android:clickable="true"
android:onClick="onClick"
I want each button to affect the ViewFlipper, as in when the next button is pressed, the next image is displayed. And, when the previous button is pressed, the previous image is displayed.
What do I need to add to the XML file and what do I need to add to the MainActivity class? Everything I've tried up until now either prevents the app opening or crashes the app when the button is pressed.
Any and all help is greatly appreciated.

Adding app widget from my app

I have written an app which has main activity and app widget.
Dragging the widget to the home screen creates new widgets, as it should. I am looking for the way to do it when the user presses a button in the app activity.
There is no way to put widget on the "Home" screen programicaly.

Android Button background Image changes back to state in XML

I have a simple soundboard which uses Buttons to represent the sounds. When a sound button is clicked. The background image is changed using the view.
Button butt = (Button)view;
butt.setBackgroundResource(buttons_on[media]);
buttons_on is a int[] representing the drawables of the buttons.
This all works perfect, but I also use a FragmentActivity to create a paged App. The App has 4 different pages which you can swipe through. When I change a button using the above code and swipe two pages to the right and than swipe back. The image of the button has changed back to it's default defined in the page.xml.
How can I prevent this behavior?
change the Buttons to ImageButtons and setting the src?
somehow prevent the page from reloading
Instead of doing that you should look at how to use a StateListDrawable. It will simplify your approach.

How to change the button with a spinner in actionbar to loading?

I have a webview and want to listen its loading event and I have a refresh button on my actionbar.
How to change the button to a spinner programmatically?
You can't magically change a button into a spinner. What you can do is disable the button and enable the spinner.
myButton.setEnabled(false);
mySpinner.setEnabled(true);
If you want to make the spinner take the place of the button, then you're going to have to put all of your layout drawing routine into a buildLayout() (or whatever you want to call it) and redraw the entire layout with a button or with a spinner, depending on the state of your application.

Categories