A ftiVi nriJJwftafit wmrmmK Android mi vimmk f fkto fwj

private void findand _modify _text_view() (

TextView text view = (TextView) findViewByld(P.id.text_view); CharSequer.ee text view old - text view. getText () ;

text view.setToxt rit&mrM text view old « "\n : TextView WIlitilJt^W^&ffc&M . " ) ;

iiS^Wftftiliffl findViewByld tfU&ft main.xml TextView ^in Mil] It fl £

fl<J getText text_view_old, setText (tlARri^Jffl, fx»«»!« 7-13

VteWTextActfvity

««i&S : iS TextView . iJpJ»rsjU£& gSftAJIRMijUftATiSJH..

iS; 1? TextView ffiiSlfffi * W7-13 TextView fifcfil

TextView -^init/Sff]# 'MWfttlMff- EditText, fljfciUtfffl«?«

"iWMiU'b-W^aWg. 'ggMttll. »Htffl^ta TextView WitffiS^Wi.APSlfc"

l-.Ms/JII -144 EditText"IMfttH. «fftfff-M.^ EditText

IWIII. (W XML ifr't^JII Button WftSMllTflf^r

<Button Android:id-"9+id/edit viewbutton"

Android:layout width "wrap content" Android:layout_height="wrap_content" Android:texL="EditView" />

teJSt'NOj "edit view button" )\ S^KM^i^j "EditView"o

private Button.OnCiickListener editview button_listener = new Button.OnClickListener 0 {

public void onClick(View v) { Intent intent = new Intent();

intent.setClass(MainActivity.this, EditTextActivity.class); startActivity(intent>; 1

V ^ Activity, UN EditTextActivity t* ft'KfJ^MM, ft , it onCreate '&JI h'fhiWtiW

public void onCreate(Bundle savedlnstanceState) { super.onCreate(savedlnstanceState); setTitie("EditTextActivity"); setContentView (P.. layout. edit view) ;

^W-ft&^Jn EditText MSItt, WfitW "

<EditText. Android: id="@+id/edit_text" Android:layout_width="fill_parent" Android:layout height="wrap_content" Android: />

fllliilfiifiiyW TextView RftK-«« -'NftAffi*TWfjt-fflP»A,

W 7-14 ffi/J^o ft 1*1 7-14 Edit Text "i WihW^iKiA jt-?. M&^StiiWWffl getTcxt

AWifl. KBiltirmiSiP-^JE&ffi, Button fr'ffi, *®jlt«ffl. HT^ffi EditView

'I'Witt, if-ft Title !;&/]<« »"fift editview.xml "^tWin ^ Button Sift, Jl-ft EditTextActivity.java + SS¿0 'T'-«I. fitillW"ftf>Y tifk*

tfjfcftfcXML i'it'h^to Button*»ft«MnTJIr>iii

<Bu tton Android: id-"@+-id/get edit view button"

Android:layout width="wrap content" Android:layout height="wrap content" Android: text«"ft IK Edi tV 1 ew tftfi" />

private Button.OnClickListener get edit._view button listener ■ new Button.OnClickListener() ( public void onClick(View v) {

EditText edit text (EditText) findViewByld(R.id.edit text); CharSequence edit text value edit text.getText(); set Title ("EditText tfiitl: "+edit text value); )

\ immih k*BfWttJi#JR EditText tm. ^M^ft Title k, KJiffttJIftlBa 7-15

a EE ' 14 EditText g * ffl / -1S ft® Edit Text fiWi
0 0

Post a comment