How to Call a Method
1. In the MainActivity.java, create a new method named myMethod.
2. In the onCreate method, add the below line. This will call the method named myMethod and process the contents, then return to the onCreate method after it is completed.
myMethod();
3. Compile and run!
Resources:
Popular Posts
- Select All Text in an EditText on Focus
- android:ellipsize - Add an ellipsis(...) in a TextView
- Cursor getColumnIndexOrThrow - Get the Index for a Column Name
- android:drawablePadding - Add Padding to a Drawable in a TextView, in XML
- Solution: Running Android Lint has encountered a problem Failed
- How to Install an SDK package
- How to Open the SDK Manager
- Save LogCat to a Text File
- requestFocus - Set Focus to a TextView, using requestFocus, in Java
- setEllipsize - Make a Scrolling Marquee, using scrollHorizontally, in a TextView