I want to automate some process.
During the execution of the process opens a webview with a button - "OK", is it possible to press it automatically by software, not touching your finge ?
You will have to do it manually. Work which you want to do, will do programatically and will show to user that button as pressed by code.
Related
I need to open all active application`s menu on emulator. I was find code how to tap on system button in particular Home and Back, but i cant find third button keyCode.
((AndroidDriver)this.getMobileDriver()).pressKey(new KeyEvent(AndroidKey.HOME));
How to tap for box button?
Replace AndroidKey.HOME with AndroidKey.APP_SWITCH in your code.
Here the full list of all available key constants: https://appium.github.io/java-client/io/appium/java_client/android/nativekey/AndroidKey.html
For all preferences pages in an Eclipse RCP application there exists both an OK button and a Cancel button.
Is it possible to disable the cancel button in the same way as one can disable the apply button?
E.g the apply button can be disabled with
noDefaultAndApplyButton();
The Cancel and OK buttons are provided by the preferences dialog rather than the current preference page - org.eclipse.jface.preference.PreferenceDialog to be exact.
This dialog does not provide a way to disable the Cancel button.
I want my app to execute a piece of code whenever the homebutton is pressed. This should also happen, when the app itself isn't currently open. I have found a way to do this with volume buttons:
How can I launch an android app on upon pressing the volume up or volume down button?
But I need it to work with the home button. Setting the app as a launcher doesn't work, as it won't work on the lockscreen then.
I want make an app by which I want to open it in small screen/view like popup window instead of Full Screen Activity.
Suppose,when a user click on the application icon in his device it will show a popup window (contains various buttons/options) instead of opening any full screen activity!
Is there any way ? If possible then, How can I proceed ?
Wishing code snapshots or any demo or necessary suggestions regarding this problem!
Not exactly a popup, but you can use the Dialog theme and make your Activity appear like a dialog box by using:
<activity android:theme="#android:style/Theme.Dialog">
My activity UI have a CheckBox which set default check is "unchecked".
I have a receiver to listen when a new incoming SMS, then the checkBox will be set "checked".
And this is my steps:
Open activity for first time.
Press Home button to let my app to background
From another phone, send a SMS to my phone.
Launch app again by click icon app
Result : The CheckBox still is uncheck. (It means my activity not reload yet)
I try to long press Home button and then remove my app from the list app, then launch app again by click icon app, after that the CheckBox is checked.
Can anybody help me explain for this ?
And how can I reload my activity without removing app from list background apps ?
Thanks
It seems some UI reloading is happening inside onCreate(). Instead do it in onResume() to update the view when user is opening the app from background.
If you remove the app from background and then start it, it will call onCreate. However if you just come back from background onResume is called but not onCreate.
Try sharing code while asking questions.
Meanwhile do read about activity life cycle.After that check where you have implemented code to enable check option and see if it is getting called while coming back to application. It is probably not getting called and that is where the issue is.
In your receiver listener save a variable in the shared preferences to indicate the state of the checkbox. Then in your on onCreate() activity grab the state from the shared preferences and update the ui accordingly.