Joe Joe - 1 year ago 83
Android Question

How to automatically fulfill task on activity start?

I have a code that requires two edittexts, this information is used to display direction on a map. How can I submit this data automatically on activity start, without the need of a button.

Side question, is there a way to hide these edittexts? To prevent further manipulation by users.

Answer Source

EditTexts can be either disabled using editText.setEnabled(false); or hidden using editText.setVisibility(View.INVISIBLE);.

If you want to execute code on an activity start just write it into the onCreate(...) method.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download