Joe Joe - 7 months ago 37
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.


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.