Sunday, 15 April 2012

android - How to Change a TextView with the values in an EditText -


I'm completely new to making the app and I want to create something that has two EditTexts (numbers only) Which was then split and turned into a percentage and was displayed in a textView. Unfortunately, I do not know what I'm doing, right. Here is my code

  import android.app.activity; Importroid.os.Bundle; Import android.view.Menu; Import android.widget.EditText; Import android.widget.TextView; Public Sector Enhances First Information Activity (EditText eT4 = (Edit Text) SearchVBIID (RID Edit 4); EditText eT5 = (EditText) Find ViewById (R.id.editText5); TextView tV6 = (TextView) findViewById ( R.id.textView6); @ Override Protected Zero to Create (Bundle Saved InstantState) {Super.Nocrat (Saved Instantstate); setContentView (R.layout.activity_first_information); if (ET4! = Null & amp; AT5 ! = Null) {Dual fraction = (double) integer. PRIIST (ET 4.getText (). ToString ()); Doh Re double = (double) integer. PRIIENT (ET 5. Gate Text) (). Toastring ()); Double TextView = MathRed (fraction / divisor) * 100; TV6.setText (TextView + ""); }} @ Override Public Boolean On Crate Option Menu (Menu Menu) {// Increase Menu; It adds the item to the Action Bar if it exists GetMenuInflater (). Flood (R. menu.fst_in formation, menu); Back true; } Public Zero updateTextView () {If (ET4! = Null & AT5! = Null) {Dual fraction = (double) integer. PRIInt (ET 4.getText (). ToString ()); Dual double = (double) integer. PRIINT (ET5GateText) () Toasting ()); Double TextView = MathRed (fraction / divisor) * 100; TV6.setText (TextView + ""); } Return; }   

}

Any feedback at all would be great thanks very much!

findViewById () in onCreate ()



No comments:

Post a Comment