Vdg

pmlcctcd volii onCcfote(Hur.dir navcdinstancescate) iuprr.onCceaieiaovedlnatonccScocel ;

✓ T.iki fr Of rti«» O LofTet CJ Pile Explorer Seurch n im si w*xawHi&m#>*

aEifc*fHJ*S.tmft SM|M*B&&f«*«7M/» . fttt ff», WiSiESTW , TUfiUÖ

/ S8 WfjZM&tiW

fflSOLWgfr -'Kii^ Dialog ftS^itiftW, private Dialog buildDi.alog2 (Context context) {

AlertDiaioq.Builder builder = new AlertDialog. Builder (context);

builder . setIcon (R. drawable . a lert_diaiog_icon) /

builder.setTitle(R.stri ng.alert dialog two buttons_msc);

builder.setMessaqe(R.string.alert_dialog_two_buttons2 rnsg);

builder.setPositiveButton(R.string.alert dialog ok, new Dialoglnterface.OnClickListener() I

public void onclick(Dialoglnterface dialog, int whichButton) {

builder.setNeutralButtcn (R.string.alert diaiog something, new Dialoglnterface.OnClickListener() I

public void onClick(DiaJoglnterlace dialog, int whichButton) (

builder.setNegativeButton<R.string.alert dialog cancel, new Dialoglnterface.OnClickListener() {

public void onClick(Dialoglnterface dialog, int whichButton) (

return bui1der.create(); »

buildDialog2()^aMiiM^t,MB^illbuildDialogl()?.ii mmmio fm»® • M<A -mm/jo

• builder.setMessage(R.string.alert dialog two buttons2 msg), ® Dialog ^fe® (title), $/frU&

• setNeutralButtonO H vi fx fi »1 't' l»J tU ill ftt " ^ H tt, JUtSH/T»» buiIdDialogl()¥.ii^^fKj fi ,

¿SMIMffl.

private Dialog buildDialog3(Context context) { Layoutlnflater inflater = Layoutlnflater.from(this); final View textEntryView = inflater.inflate ( R.layout .alert_dialog text: entry, null);

AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setIcon(R.drawable.alert dialog icon);

builder.setTitle (R. string, alert dialog text entry) ; builder.setView(textEnt ryView);

builder.setPositiveButton<R.string.alert dialog ok, new DialogInter face.OnClickListener() I

public void onClick(Dialoglnterface dialog, int whichButton) {

s e t T i 11 e <" & £ 7 tfftU ± 1ft & ft tfl ") ; >

builder. setNegat.i veButtcn (R. string . alei L_dialog_cancel, new Dialoglnterface.OnClickListener() {

public void onClick(Dialoglnterface dialog, int whichButton) (

setTitle("£ifc7*fi£*f JzfiWififc«"); \

return builder.create (); }

it Ij ttl ft f ft in jiij ii ij- i ft ffl -t* tj U; ft $ ift It fct, Dialog i*i JU£i- «*«*«

Dialog ft message, lib'Dialog &'rvi- i -^tft.itft View«

• Layoutlnflater MHUt^ft inflate t XML ft^J

view

• bui 1 der. set Vi e w( textEnt ryView) it V ^J, Dialog fttt/iKU «ilii«'»**

J!M/ftyHfett.ft View /AKii Dialog fitfii. i&T.ft textEntryView ill alert dialog textentry.xml

8. HAit tiff alert_dialog_text_entry.xmlS^5:i^, 8' - KftfcjWti K/?f/j<:

<?xml version^"1.0" encoding "utf~8"?>

<LinearLayout xrr.J ns: Android="http: //schemas . Android.com/apk/res/Android" Android:layout_width="fi11 parent" Android: layout heigh- "wrap__content " Android:orientation="vertical">

<TextView

Android:id="@+id/username view" Android:layout_height="wrap content" Android:layout widfch-Hwrap_content" Android:layout_marginLeft-"ZOdip" Android: layout_marginRight=,,20dip" Android: text

Androi d:textAppearanee-"?Android:att r/textAppearanceMedium" />

Android: id "(? »• id/username edit" Android:layout height-"wrap content" Android:layout width="fill parent" Android:layout marginLeft="20dip" Android:layout marginRight="2 0dip"

Android: c'api tali ze= "none"

Android:textAppearance="?Android:attr/textAppearanceMedium" />

<TextView

Android:id "@+id/password_view" Android:layout_height="wrap content" Android:layout_width="wrap content" Android:layoutmarginLeft-"20dip" Android:layout marginRight="20dip" Android: text»"

Android:textAppearance^"?Android:attr/textAppearanceMedium" />

<EditText

Android:id="@+id/password edit" Android: layout_ height="wrap content" Android:layout width="fill parent" Android:layout_marginLeft="20dip" Android:layout_marginRight "20dip" Android:capi talize-"none" Android:password "true"

Android:textAppearance="?Android:attr/textAppearanceMedium" /> </LinearLayout>

• Android:textAppcarance=M?Android:attr/textAppearanceMediuni", & & i/i nj ]}J & jffi Text View

• Android:capitalize="none", Android:capitalize AfKjA'h^*. iill^j none, ffijA

/i±ii alert dialog text entry, xml Xft1 M i4 ft ft.

TextView Android:textAppearance=n?Android:attr/textAppearanceMedium",

# Android:capitalize=Mnone"&$ Android:capitalize= "words", + i^XiPfi.

^ EditText MiiMj Android:password="true" Android:password-'false", jv* a >

0 0

Post a comment