I'm learning how to make UI on Android these days. I made a few EditTexts to get the price. What I want to make is to press the button and read the values in EditText.
<EditText android:id="@+id/name" android:width="220px" />
This is my EditText, so how do I get the price in here?
android android-edittext
Use getText(). Below is an example.
Button mButton;
EditText mEdit;
/** /** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mButton = (Button)findViewById(R.id.button);
mEdit = (EditText)findViewById(R.id.edittext);
mButton.setOnClickListener(
new View.OnClickListener()
{
public void onClick(View view)
{
Log.v("EditText", mEdit.getText().toString());
}
});
}
877 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
598 Uncaught (inpromise) Error on Electron: An object could not be cloned
567 Who developed the "avformat-59.dll" that comes with FFmpeg?
566 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.