Skip to content

CodingApps/ConvertMetersV1

Repository files navigation

Convert Meters Tool


Convert meters entered and display conversion to inches.


Intro

This project allows you to fill in meters and converts the value to inches.

convertmeters


Functions

  • OnClickListener for submitting value when button clicked.
  • Converting value to display.

Processing Button Click

This implemented the OnClickListener to respond to button presses on the UI. It was interesting placing the Layouts and TextViews, then having the OnClickListener process the input.

 super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

         enterMeters = (EditText) findViewById(R.id.editText);
         resultTextView = (TextView) findViewById(R.id.resultText);
         convertButton = (Button) findViewById(R.id.convertButton);

         convertButton.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
                 double multiplier = 39.37;
                 double result = 0.0;
                 ...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages