Disable Button after click

by pabbot » Sat, 12 Mar 2011 02:54:05 GMT


Sponsored Links
 Hi all,

In my application, when I click on a button that inserts a record on
the database and closes the Activity, sometimes it takes long to close
that Activity and some users are clicking on the Button twice. That
causes that the record is inserted twice in the database.

Is there any way of avoiding this behavior?

Thanks in advance!

-- 



Re: Disable Button after click

by Cliff Davies » Sat, 12 Mar 2011 02:58:53 GMT


 Set a boolean variable when the button has been pressed and check the
boolean is false in the on click listener so that you don't process it once
it's already been clicked





-- 


Sponsored Links


Re: Disable Button after click

by TreKing » Sat, 12 Mar 2011 03:03:36 GMT


 




Just disable the button when it's clicked, especially if you're closing the
Activity anyway.

-------------------------------------------------------------------------------------------------
TreKing < http://sites.google.com/site/rezmobileapps/treking> ; - Chicago
transit tracking app for Android-powered devices

-- 



Re: Disable Button after click

by Justin Anderson » Sat, 12 Mar 2011 03:07:01 GMT


 *> Is there any way of avoiding this behavior?*

Yes. Disable the button.
 http://developer.android.com/reference/android/widget/TextView.html #setEnabled%28boolean%29

Thanks,
Justin Anderson
MagouyaWare Developer
 http://sites.google.com/site/magouyaware 






-- 



Re: Disable Button after click

by Sourav Howlader » Sat, 12 Mar 2011 04:24:01 GMT


 As soon as the button is clicked, set  button.setEnable(false);
  This will disable the button and will avoid from double clicking it.




-- 



Other Threads

1. Setting for Poxy based Network Connections

Hello all,

Can anybody give me the Exact methodology for Connecting through
Android Browsers and also Exact way for making the Map application
work in my "Proxy Networked Machine"

None of the methodology in the below are working for me....

1. placing the http_proxy in settings.db
2. -http-proxy in console


thankyou

--~--~---------~--~----~------------~-------~--~----~

2. Strange Proxy setting and INTERNET problem Emulator

Hai,

I was trying to configure the "proxy" network connectivity for my
emulator run through Eclipse3.4.

I implemented the usual 2 ways already done by the users,

Solution 1 : using -http-proxy [ip]:[port]

Solution 2 : adding the http_proxy to data/data/
com.android.providers.settings/databases/settings.db and check to find
the result as below

sqlite> SELECT * FROM system;
....
....
111|http_proxy|172.24.1.1:8080
....
.....

After implementing the both ways I could not connect to the internet
and I get the following error

-------------------------------------


[2009-07-16 12:12:37 - Emulator] proxy_http_setup: creating http proxy
service connecting to: 174.24.1.1:8080
[2009-07-16 12:12:37 - Emulator] server name '174.24.1.1' resolved to
174.24.1.1:8080
[2009-07-16 12:12:37 - Emulator] proxy_http_setup: creating HTTP Proxy
Service Footer is (len=2):
[2009-07-16 12:12:37 - Emulator] '
[2009-07-16 12:12:37 - Emulator]
[2009-07-16 12:12:37 - Emulator] '
[2009-07-16 12:12:37 - Emulator] http_service_connect: trying to
connect to 209.85.153.104:80
[2009-07-16 12:12:37 - Emulator] http_service_connect: using HTTP
rewriter
[2009-07-16 12:12:37 - Emulator] tcp:209.85.153.104:80(3576): cannot
connect to proxy: <unknown error>
[2009-07-16 12:12:37 - Emulator] http_service_connect: trying to
connect to 209.85.153.104:80
[2009-07-16 12:12:37 - Emulator] http_service_connect: using HTTP
rewriter
[2009-07-16 12:12:37 - Emulator] tcp:209.85.153.104:80(3540): cannot
connect to proxy: <unknown error>


--------------------------

07-16 12:29:09.217: WARN/KeyCharacterMap(623): No keyboard for id 0
07-16 12:29:09.217: WARN/KeyCharacterMap(623): Using default keymap: /
system/usr/keychars/qwerty.kcm.bin
07-16 12:29:11.858: ERROR/ActivityThread(658): Failed to find provider
info for com.google.settings
07-16 12:29:13.288: ERROR/MapActivity(658): Couldn't get connection
factory client
07-16 12:29:55.098: WARN/WaitingHelper(658): Network error: 3


Also I am finding it impossible to integrate Google Map due to the
same problem.

Can anybody give me a solution so that I can work on it.




--~--~---------~--~----~------------~-------~--~----~

3. how to disable android keybaord by default

4. video screen disappeared after launch new task

5. NUMERIC data type in sqlite and dispay use SimpleCursorAdapter

6. How to get the android predefined view in Activity?such as "@id/android:list"

7. UMS in Android gadget driver