Get value from EditText in custom layout

anintyglymn

New Member
I have a my main activity that created a button and also implements a custom layout from within the xml. The xml is this\[code\] <com.android.control.MinutePicker android:id="@+id/MinPick" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"> </com.android.control.MinutePicker>\[/code\]The java that this is referencing is as follows. It creates an edittext and also a 2 buttons.\[code\]but1 = new Button( context );but1.setTextSize( TEXT_SIZE );but1.setText( "-" );but2 = new Button( context );but2.setTextSize( TEXT_SIZE );but2.setText( "-" );valueText = new EditText( context );valueText.setTextSize( TEXT_SIZE );valueText.setGravity( Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL );valueText.setText(0);this.setLayoutParams( new LinearLayout.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT ) );LayoutParams elementParams = new LinearLayout.LayoutParams( ELEMENT_WIDTH, ELEMENT_HEIGHT ); addView( but1, elementParams ); addView( valueText, elementParams ); addView( but2, elementParams );\[/code\]But how do I then obtain the value within the edittext as in the xml there is no explicit mention of the edittext or an id. I tried to reference it via the id of the custom layout and was unsuccessful. Could anyone point me in the correct direction.
 
Back
Top