Actually my problem is I am making custom dial pad in android I pressed one button and I want to press one more button to get the value of that button I am getting first button value only. When I remove completely finger from first button that time only I am able to press second button
Related
I would like to create activity in which it would be explained how the app is supposed to be used. On a click on a button, I would like an Activity to be opened which has next and previous buttons on the bottom. So the first screen after the click on a button would show the first instruction and you can press next to see the next instruction which opens a new screen. After going through all the instructions, I would like a Finish button to return back to the main activity.
My question is can this be made in a single activity or is it actually more activities that differ only by the text and pictures they contain?
Yes it can be done in only one activity(actually 2 if you include the main activity).
What you can do is have multiple TextViews, and when the next button is pressed, you can toggle that 1st instruction's visibility
. And so on for the next instructions. The Next/Previous buttons should determine what Textview is currently visible, so they can keep track what Textview to show next. Use switch statement
I m trying to build an app in which I want to use combination of buttons to give input and I want that when user presses multiple buttons then they can press buttons in a gap of 2 sec and then finally I want to write code for the combination of buttons. Is there any listener for this type of operation?
No there is no listener Nidhi. you may create a flag and set it on button click and unset in a timer. so when user click on a button he will not be able to click other button until timer unset the flag.
I have web app in Adnroid. I have two submit buttons inside. When I press go button on the keyboard one of then is always selected. Is there a way to manage which button is selected. How to determine which is the default submit button?
Pressing the GO button should work similar to pressing enter on a computer keyboard. So the GO button is just submitting the form, it shouldn't be triggering any specific button on the form.
I succeeded to install apk file on android emulator using Jython (monkeyrunner.bat). I also used this line of code to start the main activity: device.startActivity(component=runComponent) Now what i want is to press a button on the activity which i launched, if the button name is "Submit" than how can i send key events to press this button. Thanks and please give response ASAP.
You can use Up and down key events to go to a particular button and use center button to click on that button.
For example
device.press("DPAD_DOWN", MonkeyDevice.DOWN_AND_UP) or device.press("DPAD_UP", MonkeyDevice.DOWN_AND_UP)
to reach the particular button and then click that button using
device.press("DPAD_CENTER", MonkeyDevice.DOWN_AND_UP)
You can't click the button with the button name or id.
Another method to click on the button is to use the touch event of the MonkeyDevice. With this method you can specify the location of the button and then send a touch event to the display. For example lets say your button locates at bottom center of the screen. then you can send a touch event like this
device.touch(240, 450, 'DOWN_AND_UP') - (For HVGA screen)
This will click the location (240, 450). These co-ordinates are calculated from left top corner and the first value is X co-ordinate.
I want to add a button on the home screen and want to code in the click event of that button.
I have an application which has an activate button,As soon as this activate button is clicked i want that a Button gets created on the home screen and i want to code some database queries in its click event.I have already created that application,Now i want to place the button on the home screen.How do i do that.
Thanks in Anticipation.
I don't think you can create a button on the Home Screen on-the-fly by coding. In my book, the only way to get a button on the Home Screen is if the user adds it as a widget.
If you are using xml layout for it add the button widget you needed and set it's visibility by android:visibility="gone",when you clicked the first button to activate the button to display,make it to visible by getting the id of the corresponding button
for eg: btn2.setVisibility(View.VISIBLE);