android各种控件的事件监听及举例

下面是各种常用控件的事件监听的使用

①EditText(编辑框)的事件监听---OnKeyListener

②RadioGroup、RadioButton(单选按钮)的事件监听---OnCheckedChangeListener

③CheckBox(多选按钮)的事件监听---OnCheckedChangeListener

④Spinner(下拉列表)的事件监听---OnItemSelectedListener

⑤Menu(菜单)的事件处理---onMenuItemSelected

⑥Dialog(对话框)的事件监听---DialogInterface.OnClickListener()

至于Button的事件监听,可以在上一篇博客中看到。

第一个例子:EditText的事件监听


  1. <SPAN style="FONT-SIZE: 18px">package org.hualang.eventtest2;  
  2.   
  3. import android.app.Activity;  
  4. import android.os.Bundle;  
  5. import android.view.KeyEvent;  
  6. import android.view.View;  
  7. import android.widget.EditText;  
  8. import android.widget.TextView;  
  9.   
  10. public class EventTest2 extends Activity {  
  11.     /** Called when the activity is first created. */  
  12.     private TextView mytext;  
  13.     private EditText edittext;  
  14.     @Override  
  15.     public void onCreate(Bundle savedInstanceState) {  
  16.         super.onCreate(savedInstanceState);  
  17.         setContentView(R.layout.main);  
  18.         mytext = (TextView)findViewById(R.id.mytext);  
  19.         edittext = (EditText)findViewById(R.id.edittext);  
  20.         /** 
  21.          * 设置当EditText为空,则提示“请输入账号” 
  22.          * 在配置文件main.xml中可以用android:hint="请输入账号"来实现 
  23.          */  
  24.         edittext.setHint("请输入账号");  
  25.         //下面为EditText事件监听  
  26.         edittext.setOnKeyListener(new EditText.OnKeyListener()  
  27.         {  
  28.   
  29.             @Override  
  30.             public boolean onKey(View arg0, int arg1, KeyEvent arg2) {  
  31.                 //得到文字,显示在TextView中  
  32.                 mytext.setText("内容:"+edittext.getText().toString());  
  33.                 return false;  
  34.             }  
  35.               
  36.         });  
  37.     }  
  38. }</SPAN>  
package org.hualang.eventtest2;

import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

public class EventTest2 extends Activity {
    /** Called when the activity is first created. */
	private TextView mytext;
	private EditText edittext;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        mytext = (TextView)findViewById(R.id.mytext);
        edittext = (EditText)findViewById(R.id.edittext);
        /**
         * 设置当EditText为空,则提示“请输入账号”
         * 在配置文件main.xml中可以用android:hint="请输入账号"来实现
         */
        edittext.setHint("请输入账号");
        //下面为EditText事件监听
        edittext.setOnKeyListener(new EditText.OnKeyListener()
        {

			@Override
			public boolean onKey(View arg0, int arg1, KeyEvent arg2) {
				//得到文字,显示在TextView中
				mytext.setText("内容:"+edittext.getText().toString());
				return false;
			}
        	
        });
    }
}


main.xml

  1. <SPAN style="FONT-SIZE: 18px"><?xml version="1.0" encoding="utf-8"?>  
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
  3.     android:orientation="vertical"  
  4.     android:layout_width="fill_parent"  
  5.     android:layout_height="fill_parent"  
  6.     >  
  7. <TextView    
  8.     android:layout_width="fill_parent"   
  9.     android:layout_height="wrap_content"   
  10.     android:id="@+id/mytext"  
  11.     />  
  12. <EditText  
  13.     android:id="@+id/edittext"  
  14.     android:layout_width="fill_parent"  
  15.     android:layout_height="wrap_content"  
  16.     android:textSize="10pt"  
  17. />  
  18. </LinearLayout></SPAN>  
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:id="@+id/mytext"
    />
<EditText
	android:id="@+id/edittext"
	android:layout_width="fill_parent"
	android:layout_height="wrap_content"
	android:textSize="10pt"
/>
</LinearLayout>

第二个例子:单选按钮的事件监听处理

  1. <SPAN style="COLOR: #000000">package org.hualang.eventtest;  
  2.   
  3. import android.app.Activity;  
  4. import android.os.Bundle;  
  5. import android.view.Gravity;  
  6. import android.widget.RadioButton;  
  7. import android.widget.RadioGroup;  
  8. import android.widget.Toast;  
  9.   
  10. public class EventTest3 extends Activity {  
  11.     /** Called when the activity is first created. */  
  12.     private RadioGroup group;  
  13.     private RadioButton radio1,radio2,radio3,radio4;  
  14.     @Override  
  15.     public void onCreate(Bundle savedInstanceState) {  
  16.         super.onCreate(savedInstanceState);  
  17.         setContentView(R.layout.main);  
  18.           
  19.         group = (RadioGroup)findViewById(R.id.radiogroup1);  
  20.         radio1 = (RadioButton)findViewById(R.id.button1);  
  21.         radio2 = (RadioButton)findViewById(R.id.button2);  
  22.         radio3 = (RadioButton)findViewById(R.id.button3);  
  23.         radio4 = (RadioButton)findViewById(R.id.button4);  
  24.           
  25.         group.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {  
  26.               
  27.             @Override  
  28.             public void onCheckedChanged(RadioGroup group, int checkedId) {  
  29.                 // TODO Auto-generated method stub  
  30.                 if (checkedId == radio2.getId())  
  31.                 {  
  32.                     showMessage("正确答案:" + radio2.getText()+",恭喜你,答对了");  
  33.                 }  
  34.                 else  
  35.                 {  
  36.                     showMessage("对不起,虽然很多,但不是公认的最多");  
  37.                 }  
  38.             }  
  39.         });  
  40.     }  
  41.     public void showMessage(String str)  
  42.     {  
  43.         Toast toast = Toast.makeText(this, str, Toast.LENGTH_SHORT);  
  44.         toast.setGravity(Gravity.TOP, 0220);  
  45.         toast.show();  
  46.     }  
  47. }  
  48. <STRONG><SPAN style="FONT-SIZE: 24px; COLOR: #ff0000">main.xml</SPAN>  
  49. </STRONG></SPAN><PRE class=java name="code"><?xml version="1.0" encoding="utf-8"?>  
  50. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
  51.     android:orientation="vertical"  
  52.     android:layout_width="fill_parent"  
  53.     android:layout_height="fill_parent"  
  54.     >  
  55.     <TextView  
  56.         android:id="@+id/mytextview"  
  57.         android:layout_width="fill_parent"  
  58.         android:layout_height="wrap_content"  
  59.         android:text="哪个城市的美女最多?"  
  60.     />  
  61.     <RadioGroup  
  62.         android:id="@+id/radiogroup1"  
  63.         android:layout_width="wrap_content"  
  64.         android:layout_height="wrap_content"  
  65.         android:orientation="vertical"  
  66.     >  
  67.         <RadioButton  
  68.             android:id="@+id/button1"  
  69.             android:layout_width="wrap_content"  
  70.             android:layout_height="wrap_content"  
  71.             android:text="杭州"  
  72.         />  
  73.         <RadioButton  
  74.             android:id="@+id/button2"  
  75.             android:layout_width="wrap_content"  
  76.             android:layout_height="wrap_content"  
  77.             android:text="重庆"  
  78.         />  
  79.         <RadioButton  
  80.             android:id="@+id/button3"  
  81.             android:layout_width="wrap_content"  
  82.             android:layout_height="wrap_content"  
  83.             android:text="成都"  
  84.         />  
  85.         <RadioButton  
  86.             android:id="@+id/button4"  
  87.             android:layout_width="wrap_content"  
  88.             android:layout_height="wrap_content"  
  89.             android:text="香港"  
  90.         />  
  91.     </RadioGroup>  
  92. </LinearLayout>  
  93. <STRONG><SPAN style="COLOR: #ff0000">第三个例子:复选框的事件处理</SPAN></STRONG>  
  94. package org.hualang.eventtest4;  
  95.   
  96. import android.app.Activity;  
  97. import android.os.Bundle;  
  98. import android.view.Gravity;  
  99. import android.view.View;  
  100. import android.widget.Button;  
  101. import android.widget.CheckBox;  
  102. import android.widget.CompoundButton;  
  103. import android.widget.CompoundButton.OnCheckedChangeListener;  
  104. import android.widget.Toast;  
  105.   
  106. public class EventTest4 extends Activity {  
  107.     /** Called when the activity is first created. */  
  108.     private CheckBox ch1,ch2,ch3,ch4,ch5;  
  109.     private Button mybutton;  
  110.     @Override  
  111.     public void onCreate(Bundle savedInstanceState) {  
  112.         super.onCreate(savedInstanceState);  
  113.         setContentView(R.layout.main);  
  114.           
  115.         mybutton = (Button)findViewById(R.id.mybutton);  
  116.         ch1 = (CheckBox)findViewById(R.id.check1);  
  117.         ch2 = (CheckBox)findViewById(R.id.check2);  
  118.         ch3 = (CheckBox)findViewById(R.id.check3);  
  119.         ch4 = (CheckBox)findViewById(R.id.check4);  
  120.         ch5 = (CheckBox)findViewById(R.id.check5);  
  121.           
  122.         ch1.setOnCheckedChangeListener(new CheckBox.OnCheckedChangeListener()  
  123.         {  
  124.   
  125.             @Override  
  126.             public void onCheckedChanged(CompoundButton arg0, boolean arg1) {  
  127.                 // TODO Auto-generated method stub  
  128.                 if(ch1.isChecked())  
  129.                 {  
  130.                     showMessage("你选择了"+ch1.getText());  
  131.                 }  
  132.             }  
  133.               
  134.         });  
  135.         ch2.setOnCheckedChangeListener(new CheckBox.OnCheckedChangeListener()  
  136.         {  
  137.   
  138.             @Override  
  139.             public void onCheckedChanged(CompoundButton arg0, boolean arg1) {  
  140.                 // TODO Auto-generated method stub  
  141.                 if(ch3.isChecked())  
  142.                 {  
  143.                     showMessage("你选择了"+ch2.getText());  
  144.                 }  
  145.             }  
  146.               
  147.         });  
  148.         ch3.setOnCheckedChangeListener(new CheckBox.OnCheckedChangeListener()  
  149.         {  
  150.   
  151.             @Override  
  152.             public void onCheckedChanged(CompoundButton arg0, boolean arg1) {  
  153.                 // TODO Auto-generated method stub  
  154.                 if(ch3.isChecked())  
  155.                 {  
  156.                     showMessage("你选择了"+ch3.getText());  
  157.                 }  
  158.             }  
  159.               
  160.         });  
  161.         ch4.setOnCheckedChangeListener(new CheckBox.OnCheckedChangeListener()  
  162.         {  
  163.   
  164.             @Override  
  165.             public void onCheckedChanged(CompoundButton arg0, boolean arg1) {  
  166.                 // TODO Auto-generated method stub  
  167.                 if(ch4.isChecked())  
  168.                 {  
  169.                     showMessage("你选择了"+ch4.getText());  
  170.                 }  
  171.             }  
  172.               
  173.         });  
  174.         ch5.setOnCheckedChangeListener(new CheckBox.OnCheckedChangeListener()  
  175.         {  
  176.   
  177.             @Override  
  178.             public void onCheckedChanged(CompoundButton arg0, boolean arg1) {  
  179.                 // TODO Auto-generated method stub  
  180.                 if(ch5.isChecked())  
  181.                 {  
  182.                     showMessage("你选择了"+ch5.getText());  
  183.                 }  
  184.             }  
  185.               
  186.         });  
  187.           
  188.         mybutton.setOnClickListener(new Button.OnClickListener()  
  189.         {  
  190.   
  191.             @Override  
  192.             public void onClick(View arg0) {  
  193.                 // TODO Auto-generated method stub  
  194.                 int num = 0;  
  195.                 if(ch1.isChecked())  
  196.                 {  
  197.                     num++;  
  198.                 }  
  199.                 if(ch2.isChecked())  
  200.                 {  
  201.                     num++;  
  202.                 }  
  203.                 if(ch3.isChecked())  
  204.                 {  
  205.                     num++;  
  206.                 }  
  207.                 if(ch4.isChecked())  
  208.                 {  
  209.                     num++;  
  210.                 }  
  211.                 if(ch5.isChecked())  
  212.                 {  
  213.                     num++;  
  214.                 }  
  215.                   
  216.                 showMessage("谢谢参与,您一共选择了"+num+"项");  
  217.                   
  218.             }  
  219.               
  220.         });  
  221.     }  
  222.       
  223.   
  224.       
  225.     public void showMessage(String str)  
  226.     {  
  227.         Toast toast = Toast.makeText(this, str, Toast.LENGTH_SHORT);  
  228.         toast.setGravity(Gravity.TOP, 0220);  
  229.         toast.show();  
  230.     }  
  231. }  
  232. <SPAN style="FONT-SIZE: 24px; COLOR: #ff0000">main.xml</SPAN>  
  233. <?xml version="1.0" encoding="utf-8"?>  
  234. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
  235.     android:orientation="vertical"  
  236.     android:layout_width="fill_parent"  
  237.     android:layout_height="fill_parent"  
  238.     >  
  239.     <TextView    
  240.         android:layout_width="fill_parent"   
  241.         android:layout_height="wrap_content"   
  242.         android:text="你喜欢哪些智能手机系统"  
  243.         />  
  244.     <CheckBox  
  245.         android:id="@+id/check1"  
  246.         android:layout_width="fill_parent"  
  247.         android:layout_height="wrap_content"  
  248.         android:text="苹果 ios"  
  249.     />  
  250.     <CheckBox  
  251.         android:id="@+id/check2"  
  252.         android:layout_width="fill_parent"  
  253.         android:layout_height="wrap_content"  
  254.         android:text="谷歌 Android"  
  255.     />  
  256.     <CheckBox  
  257.         android:id="@+id/check3"  
  258.         android:layout_width="fill_parent"  
  259.         android:layout_height="wrap_content"  
  260.         android:text="RIM BlackBerry"  
  261.     />  
  262.     <CheckBox  
  263.         android:id="@+id/check4"  
  264.         android:layout_width="fill_parent"  
  265.         android:layout_height="wrap_content"  
  266.         android:text="微软 Windows phone 7"  
  267.     />  
  268.     <CheckBox  
  269.         android:id="@+id/check5"  
  270.         android:layout_width="fill_parent"  
  271.         android:layout_height="wrap_content"  
  272.         android:text="诺基亚 symbian"  
  273.     />  
  274.     <Button  
  275.         android:id="@+id/mybutton"  
  276.         android:layout_width="fill_parent"  
  277.         android:layout_height="wrap_content"  
  278.         android:text="确定"  
  279.     />  
  280.   
  281. </LinearLayout>  
  282.   
  283. <SPAN style="COLOR: #ff0000"><STRONG>第四个例子:Spinner下拉菜单的事件处理</STRONG></SPAN>  
  284. package org.hualang.eventtest5;  
  285.   
  286. import android.app.Activity;     
  287. import android.os.Bundle;     
  288. import android.view.View;     
  289. import android.widget.AdapterView;     
  290. import android.widget.ArrayAdapter;     
  291. import android.widget.Spinner;     
  292. import android.widget.TextView;     
  293.     
  294. public class EventTest5 extends Activity {     
  295.     /** Called when the activity is first created. */    
  296.     private static final String[] citys={"杭州","北京","成都","大连","深圳","南京"};     
  297.     private TextView text;     
  298.     private Spinner spinner;     
  299.     private ArrayAdapter<String> adapter;     
  300.     @Override    
  301.     public void onCreate(Bundle savedInstanceState) {     
  302.         super.onCreate(savedInstanceState);     
  303.         setContentView(R.layout.main);     
  304.         text=(TextView)findViewById(R.id.text);     
  305.         spinner=(Spinner)findViewById(R.id.spinner);     
  306.              
  307.         //将可选内容与ArrayAdapter连接     
  308.         adapter=new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,citys);     
  309.         //设置下拉列表风格     
  310.         adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);     
  311.         //将adapter添加到spinner中     
  312.         spinner.setAdapter(adapter);     
  313.         //添加Spinner事件监听     
  314.         spinner.setOnItemSelectedListener(new Spinner.OnItemSelectedListener()     
  315.         {     
  316.     
  317.             @Override    
  318.             public void onItemSelected(AdapterView<?> arg0, View arg1,     
  319.                     int arg2, long arg3) {     
  320.                 // TODO Auto-generated method stub     
  321.                 text.setText("你所在的城市是:"+citys[arg2]);     
  322.                 //设置显示当前选择的项     
  323.                 arg0.setVisibility(View.VISIBLE);     
  324.             }     
  325.     
  326.             @Override    
  327.             public void onNothingSelected(AdapterView<?> arg0) {     
  328.                 // TODO Auto-generated method stub     
  329.                      
  330.             }     
  331.                  
  332.         });     
  333.     }     
  334. }    
  335.   
  336. <SPAN style="FONT-SIZE: 24px; COLOR: #ff0000">main.xml</SPAN>  
  337. <?xml version="1.0" encoding="utf-8"?>     
  338. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    
  339.     android:orientation="vertical"    
  340.     android:layout_width="fill_parent"    
  341.     android:layout_height="fill_parent"    
  342.     >     
  343. <TextView       
  344.     android:id="@+id/text"    
  345.     android:layout_width="fill_parent"      
  346.     android:layout_height="wrap_content"      
  347.     android:text="您所在的城市"    
  348.     />     
  349. <Spinner     
  350.     android:id="@+id/spinner"    
  351.     android:layout_width="wrap_content"    
  352.     android:layout_height="wrap_content"    
  353.     android:layout_centerHorizontal="true"    
  354. />     
  355. </LinearLayout>  
  356.   
  357. <STRONG><SPAN style="COLOR: #ff0000">第五个例子:Menu(菜单)的事件处理</SPAN></STRONG>   
  358. </PRE><BR>  
  359. <PRE class=java name="code">package org.hualang.eventtest6;  
  360.   
  361. import android.app.Activity;  
  362. import android.os.Bundle;  
  363. import android.view.Menu;  
  364. import android.view.MenuInflater;  
  365. import android.view.MenuItem;  
  366. import android.widget.Toast;  
  367.   
  368. public class EventTest6 extends Activity {  
  369.     /** Called when the activity is first created. */  
  370.     @Override  
  371.     public void onCreate(Bundle savedInstanceState) {  
  372.         super.onCreate(savedInstanceState);  
  373.         setContentView(R.layout.main);  
  374.     }  
  375.   
  376.     @Override  
  377.     public boolean onCreateOptionsMenu(Menu menu) {  
  378.         // TODO Auto-generated method stub  
  379.         MenuInflater inflater = getMenuInflater();  
  380.         //设置menu界面为res/menu/menu.xml  
  381.         inflater.inflate(R.menu.menu, menu);  
  382.         return true;  
  383.     }  
  384.   
  385.     @Override  
  386.     public boolean onMenuItemSelected(int featureId, MenuItem item) {  
  387.         //得到当前选中的MenuItem的ID  
  388.         int itemId = item.getItemId();  
  389.         switch(itemId)  
  390.         {  
  391.         case R.id.apple:  
  392.             Toast toast = Toast.makeText(this"这是苹果", Toast.LENGTH_SHORT);  
  393.             toast.show();  
  394.             break;  
  395.         case R.id.banana:  
  396.             Toast toast2 = Toast.makeText(this"这是香蕉", Toast.LENGTH_SHORT);  
  397.             toast2.show();  
  398.             break;  
  399.         case R.id.exit:  
  400.             EventTest6.this.finish();  
  401.             break;  
  402.         }  
  403.         return true;  
  404.     }  
  405.       
  406.       
  407. }</PRE><BR>  
  408. <SPAN style="FONT-SIZE: 24px; COLOR: #ff0000">main.xml</SPAN><BR>  
  409. <?xml version="1.0" encoding="utf-8"?><BR>  
  410. <menu xmlns:android="http://schemas.android.com/apk/res/android"><BR>  
  411.     <item android:id="@+id/apple"<BR>  
  412.         android:title="苹果"<BR>  
  413.     /><BR>  
  414.     <item android:id="@+id/banana"<BR>  
  415.         android:title="香蕉"<BR>  
  416.         /><BR>  
  417.     <item android:id="@+id/exit"<BR>  
  418.         android:title="退出"<BR>  
  419.         /><BR>  
  420. </menu><BR>  
  421. <SPAN style="COLOR: #ff0000"><STRONG>第六个例子:对话框的事件处理</STRONG></SPAN><BR>  
  422. package org.hualang.dialog;<BR>  
  423. <BR>  
  424. import android.app.Activity;<BR>  
  425. import android.app.AlertDialog;<BR>  
  426. import android.app.Dialog;<BR>  
  427. import android.app.ProgressDialog;<BR>  
  428. import android.content.DialogInterface;<BR>  
  429. import android.content.DialogInterface.OnClickListener;<BR>  
  430. import android.os.Bundle;<BR>  
  431. import android.view.LayoutInflater;<BR>  
  432. import android.view.View;<BR>  
  433. <BR>  
  434. public class MainActivity extends Activity {<BR>  
  435.     /** Called when the activity is first created. */<BR>  
  436.     ProgressDialog myDialog;<BR>  
  437.     @Override<BR>  
  438.     public void onCreate(Bundle savedInstanceState) {<BR>  
  439.         super.onCreate(savedInstanceState);<BR>  
  440.         setContentView(R.layout.main);<BR>  
  441.         <BR>  
  442.         Dialog dialog = new AlertDialog.Builder(MainActivity.this)<BR>  
  443.         .setTitle("登录提示")<BR>  
  444.         .setMessage("这里需要登录")<BR>  
  445.         .setPositiveButton("确定"new DialogInterface.OnClickListener() {<BR>  
  446.             <BR>  
  447.             @Override<BR>  
  448.             public void onClick(DialogInterface dialog, int which) {<BR>  
  449.                 // TODO Auto-generated method stub<BR>  
  450.                 LayoutInflater factory = LayoutInflater.from(MainActivity.this);<BR>  
  451.                 final View DialogView = factory.inflate(R.layout.dialog, null);<BR>  
  452.                 AlertDialog dlg = new AlertDialog.Builder(MainActivity.this)<BR>  
  453.                 .setTitle("登录框")<BR>  
  454.                 .setView(DialogView)<BR>  
  455.                 .setPositiveButton("确定"new DialogInterface.OnClickListener() {<BR>  
  456.                     <BR>  
  457.                     @Override<BR>  
  458.                     public void onClick(DialogInterface dialog, int whichButton) {<BR>  
  459.                         // TODO Auto-generated method stub<BR>  
  460.                         myDialog = ProgressDialog.show(MainActivity.this"请等待...""正在为你登录"true);<BR>  
  461.                         new Thread()<BR>  
  462.                         {<BR>  
  463.                             public void run()<BR>  
  464.                             {<BR>  
  465.                                 try<BR>  
  466.                                 {<BR>  
  467.                                     sleep(3000);<BR>  
  468.                                 }catch(Exception e)<BR>  
  469.                                 {<BR>  
  470.                                     e.printStackTrace();<BR>  
  471.                                 }finally<BR>  
  472.                                 {<BR>  
  473.                                     myDialog.dismiss();<BR>  
  474.                                 }<BR>  
  475.                             }<BR>  
  476.                         }.start();<BR>  
  477.                     }<BR>  
  478.                 }).setNegativeButton("取消",<BR>  
  479.                         new DialogInterface.OnClickListener() {<BR>  
  480.                             <BR>  
  481.                             @Override<BR>  
  482.                             public void onClick(DialogInterface dialog, int which) {<BR>  
  483.                                 // TODO Auto-generated method stub<BR>  
  484.                                 MainActivity.this.finish();<BR>  
  485.                             }<BR>  
  486.                         }).create();<BR>  
  487.                 dlg.show();<BR>  
  488.             }<BR>  
  489.         }).setNeutralButton("退出"new DialogInterface.OnClickListener() {<BR>  
  490.             <BR>  
  491.             @Override<BR>  
  492.             public void onClick(DialogInterface dialog, int which) {<BR>  
  493.                 // TODO Auto-generated method stub<BR>  
  494.                 MainActivity.this.finish();<BR>  
  495.             }<BR>  
  496.         }).create();<BR>  
  497.         dialog.show();<BR>  
  498.     <BR>  
  499.     }<BR>  
  500. }<BR>  
  501. <SPAN style="FONT-SIZE: 24px; COLOR: #ff0000">xml文件</SPAN><BR>  
  502. <?xml version="1.0" encoding="utf-8"?><BR>  
  503. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"<BR>  
  504.     android:orientation="vertical"<BR>  
  505.     android:layout_width="fill_parent"<BR>  
  506.     android:layout_height="fill_parent"<BR>  
  507.     ><BR>  
  508.     <TextView  <BR>  
  509.         android:id="@+id/username"<BR>  
  510.         android:layout_width="wrap_content" <BR>  
  511.         android:layout_height="wrap_content"<BR>  
  512.         android:layout_marginLeft="20dip"<BR>  
  513.         android:layout_marginRight="20dip" <BR>  
  514.         android:text="账号"<BR>  
  515.         android:gravity="left"<BR>  
  516.         android:textAppearance="?android:attr/textAppearanceMedium"<BR>  
  517.     /><BR>  
  518.       <EditText<BR>  
  519.           android:id="@+id/myusername"<BR>  
  520.           android:layout_height="wrap_content"<BR>  
  521.           android:layout_width="fill_parent"<BR>  
  522.           android:layout_marginLeft="20dip"<BR>  
  523.           android:layout_marginRight="20dip"<BR>  
  524.           android:scrollHorizontally="true"<BR>  
  525.           android:autoText="false"<BR>  
  526.           android:capitalize="none"<BR>  
  527.           android:gravity="fill_horizontal"<BR>  
  528.           android:textAppearance="?android:attr/textAppearanceMedium"<BR>  
  529.       /><BR>  
  530.       <TextView<BR>  
  531.           android:id="@+id/password"<BR>  
  532.           android:layout_width="fill_parent"<BR>  
  533.           android:layout_height="wrap_content"<BR>  
  534.           android:layout_marginLeft="20dip"<BR>  
  535.           android:layout_marginRight="20dip"<BR>  
  536.           android:text="密码"<BR>  
  537.           android:gravity="left"<BR>  
  538.           android:textAppearance="?android:attr/textAppearanceMedium"<BR>  
  539.       /><BR>  
  540.       <EditText<BR>  
  541.           android:id="@+id/mypassword"<BR>  
  542.           android:layout_width="fill_parent"<BR>  
  543.           android:layout_height="wrap_content"<BR>  
  544.           android:layout_marginLeft="20dip"<BR>  
  545.           android:layout_marginRight="20dip"<BR>  
  546.           android:scrollHorizontally="true"<BR>  
  547.           android:autoText="false"<BR>  
  548.           android:capitalize="none"<BR>  
  549.           android:gravity="fill_horizontal"<BR>  
  550.           android:password="true"<BR>  
  551.       /><BR>  
  552. </LinearLayout><BR>  
  553. <P></P>  
  554. <PRE></PRE>  
  555. <STRONG><SPAN style="COLOR: #ff0000"><BR>  
  556. <BR>  
  557. </SPAN></STRONG>  
  558. <P></P>  
  559. <P></P>  
  560. <P><SPAN style="FONT-SIZE: 18px"><BR>  
  561. </SPAN></P>  
  562. <P><SPAN style="FONT-SIZE: 18px"><BR>  
  563. </SPAN></P>  
  564. <SPAN style="FONT-SIZE: 18px"><BR>  
  565. </SPAN><BR>  
package org.hualang.eventtest;

import android.app.Activity;
import android.os.Bundle;
import android.view.Gravity;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Toast;

public class EventTest3 extends Activity {
    /** Called when the activity is first created. */
	private RadioGroup group;
	private RadioButton radio1,radio2,radio3,radio4;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        group = (RadioGroup)findViewById(R.id.radiogroup1);
        radio1 = (RadioButton)findViewById(R.id.button1);
        radio2 = (RadioButton)findViewById(R.id.button2);
        radio3 = (RadioButton)findViewById(R.id.button3);
        radio4 = (RadioButton)findViewById(R.id.button4);
        
        group.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
			
			@Override
			public void onCheckedChanged(RadioGroup group, int checkedId) {
				// TODO Auto-generated method stub
				if (checkedId == radio2.getId())
				{
					showMessage("正确答案:" + radio2.getText()+",恭喜你,答对了");
				}
				else
				{
					showMessage("对不起,虽然很多,但不是公认的最多");
				}
			}
		});
    }
    public void showMessage(String str)
    {
    	Toast toast = Toast.makeText(this, str, Toast.LENGTH_SHORT);
    	toast.setGravity(Gravity.TOP, 0, 220);
    	toast.show();
    }
}
main.xml

  
  
  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
  3.     android:orientation="vertical"  
  4.     android:layout_width="fill_parent"  
  5.     android:layout_height="fill_parent"  
  6.     >  
  7.     <TextView  
  8.         android:id="@+id/mytextview"  
  9.         android:layout_width="fill_parent"  
  10.         android:layout_height="wrap_content"  
  11.         android:text="哪个城市的美女最多?"  
  12.     />  
  13.     <RadioGroup  
  14.         android:id="@+id/radiogroup1"  
  15.         android:layout_width="wrap_content"  
  16.         android:layout_height="wrap_content"  
  17.         android:orientation="vertical"  
  18.     >  
  19.         <RadioButton  
  20.             android:id="@+id/button1"  
  21.             android:layout_width="wrap_content"  
  22.             android:layout_height="wrap_content"  
  23.             android:text="杭州"  
  24.         />  
  25.         <RadioButton  
  26.             android:id="@+id/button2"  
  27.             android:layout_width="wrap_content"  
  28.             android:layout_height="wrap_content"  
  29.             android:text="重庆"  
  30.         />  
  31.         <RadioButton  
  32.             android:id="@+id/button3"  
  33.             android:layout_width="wrap_content"  
  34.             android:layout_height="wrap_content"  
  35.             android:text="成都"  
  36.         />  
  37.         <RadioButton  
  38.             android:id="@+id/button4"  
  39.             android:layout_width="wrap_content"  
  40.             android:layout_height="wrap_content"  
  41.             android:text="香港"  
  42.         />  
  43.     </RadioGroup>  
  44. </LinearLayout>  
  45. <STRONG><SPAN style="COLOR: #ff0000">第三个例子:复选框的事件处理</SPAN></STRONG>  
  46. package org.hualang.eventtest4;  
  47.   
  48. import android.app.Activity;  
  49. import android.os.Bundle;  
  50. import android.view.Gravity;  
  51. import android.view.View;  
  52. import android.widget.Button;  
  53. import android.widget.CheckBox;  
  54. import android.widget.CompoundButton;  
  55. import android.widget.CompoundButton.OnCheckedChangeListener;  
  56. import android.widget.Toast;  
  57.   
  58. public class EventTest4 extends Activity {  
  59.     /** Called when the activity is first created. */  
  60.     private CheckBox ch1,ch2,ch3,ch4,ch5;  
  61.     private Button mybutton;  
  62.     @Override  
  63.     public void onCreate(Bundle savedInstanceState) {  
  64.         super.onCreate(savedInstanceState);  
  65.         setContentView(R.layout.main);  
  66.           
  67.         mybutton = (Button)findViewById(R.id.mybutton);  
  68.         ch1 = (CheckBox)findViewById(R.id.check1);  
  69.         ch2 = (CheckBox)findViewById(R.id.check2);  
  70.         ch3 = (CheckBox)findViewById(R.id.check3);  
  71.         ch4 = (CheckBox)findViewById(R.id.check4);  
  72.         ch5 = (CheckBox)findViewById(R.id.check5);  
  73.           
  74.         ch1.setOnCheckedChangeListener(new CheckBox.OnCheckedChangeListener()  
  75.         {  
  76.   
  77.             @Override  
  78.             public void onCheckedChanged(CompoundButton arg0, boolean arg1) {  
  79.                 // TODO Auto-generated method stub   
  80.                 if(ch1.isChecked())  
  81.                 {  
  82.                     showMessage("你选择了"+ch1.getText());  
  83.                 }  
  84.             }  
  85.               
  86.         });  
  87.         ch2.setOnCheckedChangeListener(new CheckBox.OnCheckedChangeListener()  
  88.         {  
  89.   
  90.             @Override  
  91.             public void onCheckedChanged(CompoundButton arg0, boolean arg1) {  
  92.                 // TODO Auto-generated method stub   
  93.                 if(ch3.isChecked())  
  94.                 {  
  95.                     showMessage("你选择了"+ch2.getText());  
  96.                 }  
  97.             }  
  98.               
  99.         });  
  100.         ch3.setOnCheckedChangeListener(new CheckBox.OnCheckedChangeListener()  
  101.         {  
  102.   
  103.             @Override  
  104.             public void onCheckedChanged(CompoundButton arg0, boolean arg1) {  
  105.                 // TODO Auto-generated method stub   
  106.                 if(ch3.isChecked())  
  107.                 {  
  108.                     showMessage("你选择了"+ch3.getText());  
  109.                 }  
  110.             }  
  111.               
  112.         });  
  113.         ch4.setOnCheckedChangeListener(new CheckBox.OnCheckedChangeListener()  
  114.         {  
  115.   
  116.             @Override  
  117.             public void onCheckedChanged(CompoundButton arg0, boolean arg1) {  
  118.                 // TODO Auto-generated method stub   
  119.                 if(ch4.isChecked())  
  120.                 {  
  121.                     showMessage("你选择了"+ch4.getText());  
  122.                 }  
  123.             }  
  124.               
  125.         });  
  126.         ch5.setOnCheckedChangeListener(new CheckBox.OnCheckedChangeListener()  
  127.         {  
  128.   
  129.             @Override  
  130.             public void onCheckedChanged(CompoundButton arg0, boolean arg1) {  
  131.                 // TODO Auto-generated method stub   
  132.                 if(ch5.isChecked())  
  133.                 {  
  134.                     showMessage("你选择了"+ch5.getText());  
  135.                 }  
  136.             }  
  137.               
  138.         });  
  139.           
  140.         mybutton.setOnClickListener(new Button.OnClickListener()  
  141.         {  
  142.   
  143.             @Override  
  144.             public void onClick(View arg0) {  
  145.                 // TODO Auto-generated method stub   
  146.                 int num = 0;  
  147.                 if(ch1.isChecked())  
  148.                 {  
  149.                     num++;  
  150.                 }  
  151.                 if(ch2.isChecked())  
  152.                 {  
  153.                     num++;  
  154.                 }  
  155.                 if(ch3.isChecked())  
  156.                 {  
  157.                     num++;  
  158.                 }  
  159.                 if(ch4.isChecked())  
  160.                 {  
  161.                     num++;  
  162.                 }  
  163.                 if(ch5.isChecked())  
  164.                 {  
  165.                     num++;  
  166.                 }  
  167.                   
  168.                 showMessage("谢谢参与,您一共选择了"+num+"项");  
  169.                   
  170.             }  
  171.               
  172.         });  
  173.     }  
  174.       
  175.   
  176.       
  177.     public void showMessage(String str)  
  178.     {  
  179.         Toast toast = Toast.makeText(this, str, Toast.LENGTH_SHORT);  
  180.         toast.setGravity(Gravity.TOP, 0220);  
  181.         toast.show();  
  182.     }  
  183. }  
  184. <SPAN style="FONT-SIZE: 24px; COLOR: #ff0000">main.xml</SPAN>  
  185. <?xml version="1.0" encoding="utf-8"?>  
  186. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
  187.     android:orientation="vertical"  
  188.     android:layout_width="fill_parent"  
  189.     android:layout_height="fill_parent"  
  190.     >  
  191.     <TextView    
  192.         android:layout_width="fill_parent"   
  193.         android:layout_height="wrap_content"   
  194.         android:text="你喜欢哪些智能手机系统"  
  195.         />  
  196.     <CheckBox  
  197.         android:id="@+id/check1"  
  198.         android:layout_width="fill_parent"  
  199.         android:layout_height="wrap_content"  
  200.         android:text="苹果 ios"  
  201.     />  
  202.     <CheckBox  
  203.         android:id="@+id/check2"  
  204.         android:layout_width="fill_parent"  
  205.         android:layout_height="wrap_content"  
  206.         android:text="谷歌 Android"  
  207.     />  
  208.     <CheckBox  
  209.         android:id="@+id/check3"  
  210.         android:layout_width="fill_parent"  
  211.         android:layout_height="wrap_content"  
  212.         android:text="RIM BlackBerry"  
  213.     />  
  214.     <CheckBox  
  215.         android:id="@+id/check4"  
  216.         android:layout_width="fill_parent"  
  217.         android:layout_height="wrap_content"  
  218.         android:text="微软 Windows phone 7"  
  219.     />  
  220.     <CheckBox  
  221.         android:id="@+id/check5"  
  222.         android:layout_width="fill_parent"  
  223.         android:layout_height="wrap_content"  
  224.         android:text="诺基亚 symbian"  
  225.     />  
  226.     <Button  
  227.         android:id="@+id/mybutton"  
  228.         android:layout_width="fill_parent"  
  229.         android:layout_height="wrap_content"  
  230.         android:text="确定"  
  231.     />  
  232.   
  233. </LinearLayout>  
  234.   
  235. <SPAN style="COLOR: #ff0000"><STRONG>第四个例子:Spinner下拉菜单的事件处理</STRONG></SPAN>  
  236. package org.hualang.eventtest5;  
  237.   
  238. import android.app.Activity;     
  239. import android.os.Bundle;     
  240. import android.view.View;     
  241. import android.widget.AdapterView;     
  242. import android.widget.ArrayAdapter;     
  243. import android.widget.Spinner;     
  244. import android.widget.TextView;     
  245.     
  246. public class EventTest5 extends Activity {     
  247.     /** Called when the activity is first created. */    
  248.     private static final String[] citys={"杭州","北京","成都","大连","深圳","南京"};     
  249.     private TextView text;     
  250.     private Spinner spinner;     
  251.     private ArrayAdapter<String> adapter;     
  252.     @Override    
  253.     public void onCreate(Bundle savedInstanceState) {     
  254.         super.onCreate(savedInstanceState);     
  255.         setContentView(R.layout.main);     
  256.         text=(TextView)findViewById(R.id.text);     
  257.         spinner=(Spinner)findViewById(R.id.spinner);     
  258.              
  259.         //将可选内容与ArrayAdapter连接      
  260.         adapter=new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,citys);     
  261.         //设置下拉列表风格      
  262.         adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);     
  263.         //将adapter添加到spinner中      
  264.         spinner.setAdapter(adapter);     
  265.         //添加Spinner事件监听      
  266.         spinner.setOnItemSelectedListener(new Spinner.OnItemSelectedListener()     
  267.         {     
  268.     
  269.             @Override    
  270.             public void onItemSelected(AdapterView<?> arg0, View arg1,     
  271.                     int arg2, long arg3) {     
  272.                 // TODO Auto-generated method stub      
  273.                 text.setText("你所在的城市是:"+citys[arg2]);     
  274.                 //设置显示当前选择的项      
  275.                 arg0.setVisibility(View.VISIBLE);     
  276.             }     
  277.     
  278.             @Override    
  279.             public void onNothingSelected(AdapterView<?> arg0) {     
  280.                 // TODO Auto-generated method stub      
  281.                      
  282.             }     
  283.                  
  284.         });     
  285.     }     
  286. }    
  287.   
  288. <SPAN style="FONT-SIZE: 24px; COLOR: #ff0000">main.xml</SPAN>  
  289. <?xml version="1.0" encoding="utf-8"?>     
  290. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    
  291.     android:orientation="vertical"    
  292.     android:layout_width="fill_parent"    
  293.     android:layout_height="fill_parent"    
  294.     >     
  295. <TextView       
  296.     android:id="@+id/text"    
  297.     android:layout_width="fill_parent"      
  298.     android:layout_height="wrap_content"      
  299.     android:text="您所在的城市"    
  300.     />     
  301. <Spinner     
  302.     android:id="@+id/spinner"    
  303.     android:layout_width="wrap_content"    
  304.     android:layout_height="wrap_content"    
  305.     android:layout_centerHorizontal="true"    
  306. />     
  307. </LinearLayout>  
  308.   
  309. <STRONG><SPAN style="COLOR: #ff0000">第五个例子:Menu(菜单)的事件处理</SPAN></STRONG>   

  1. package org.hualang.eventtest6;  
  2.   
  3. import android.app.Activity;  
  4. import android.os.Bundle;  
  5. import android.view.Menu;  
  6. import android.view.MenuInflater;  
  7. import android.view.MenuItem;  
  8. import android.widget.Toast;  
  9.   
  10. public class EventTest6 extends Activity {  
  11.     /** Called when the activity is first created. */  
  12.     @Override  
  13.     public void onCreate(Bundle savedInstanceState) {  
  14.         super.onCreate(savedInstanceState);  
  15.         setContentView(R.layout.main);  
  16.     }  
  17.   
  18.     @Override  
  19.     public boolean onCreateOptionsMenu(Menu menu) {  
  20.         // TODO Auto-generated method stub  
  21.         MenuInflater inflater = getMenuInflater();  
  22.         //设置menu界面为res/menu/menu.xml  
  23.         inflater.inflate(R.menu.menu, menu);  
  24.         return true;  
  25.     }  
  26.   
  27.     @Override  
  28.     public boolean onMenuItemSelected(int featureId, MenuItem item) {  
  29.         //得到当前选中的MenuItem的ID  
  30.         int itemId = item.getItemId();  
  31.         switch(itemId)  
  32.         {  
  33.         case R.id.apple:  
  34.             Toast toast = Toast.makeText(this"这是苹果", Toast.LENGTH_SHORT);  
  35.             toast.show();  
  36.             break;  
  37.         case R.id.banana:  
  38.             Toast toast2 = Toast.makeText(this"这是香蕉", Toast.LENGTH_SHORT);  
  39.             toast2.show();  
  40.             break;  
  41.         case R.id.exit:  
  42.             EventTest6.this.finish();  
  43.             break;  
  44.         }  
  45.         return true;  
  46.     }  
  47.       
  48.       
  49. }  
package org.hualang.eventtest6;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.Toast;

public class EventTest6 extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// TODO Auto-generated method stub
		MenuInflater inflater = getMenuInflater();
		//设置menu界面为res/menu/menu.xml
		inflater.inflate(R.menu.menu, menu);
		return true;
	}

	@Override
	public boolean onMenuItemSelected(int featureId, MenuItem item) {
		//得到当前选中的MenuItem的ID
		int itemId = item.getItemId();
		switch(itemId)
		{
		case R.id.apple:
			Toast toast = Toast.makeText(this, "这是苹果", Toast.LENGTH_SHORT);
			toast.show();
			break;
		case R.id.banana:
			Toast toast2 = Toast.makeText(this, "这是香蕉", Toast.LENGTH_SHORT);
			toast2.show();
			break;
		case R.id.exit:
			EventTest6.this.finish();
			break;
		}
		return true;
	}
    
    
}

main.xml
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+id/apple"
        android:title="苹果"
    />
    <item android:id="@+id/banana"
        android:title="香蕉"
        />
    <item android:id="@+id/exit"
        android:title="退出"
        />
</menu>
第六个例子:对话框的事件处理
package org.hualang.dialog;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;

public class MainActivity extends Activity {
    /** Called when the activity is first created. */
    ProgressDialog myDialog;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        Dialog dialog = new AlertDialog.Builder(MainActivity.this)
        .setTitle("登录提示")
        .setMessage("这里需要登录")
        .setPositiveButton("确定", new DialogInterface.OnClickListener() {
            
            @Override
            public void onClick(DialogInterface dialog, int which) {
                // TODO Auto-generated method stub
                LayoutInflater factory = LayoutInflater.from(MainActivity.this);
                final View DialogView = factory.inflate(R.layout.dialog, null);
                AlertDialog dlg = new AlertDialog.Builder(MainActivity.this)
                .setTitle("登录框")
                .setView(DialogView)
                .setPositiveButton("确定", new DialogInterface.OnClickListener() {
                    
                    @Override
                    public void onClick(DialogInterface dialog, int whichButton) {
                        // TODO Auto-generated method stub
                        myDialog = ProgressDialog.show(MainActivity.this, "请等待...", "正在为你登录", true);
                        new Thread()
                        {
                            public void run()
                            {
                                try
                                {
                                    sleep(3000);
                                }catch(Exception e)
                                {
                                    e.printStackTrace();
                                }finally
                                {
                                    myDialog.dismiss();
                                }
                            }
                        }.start();
                    }
                }).setNegativeButton("取消",
                        new DialogInterface.OnClickListener() {
                            
                            @Override
                            public void onClick(DialogInterface dialog, int which) {
                                // TODO Auto-generated method stub
                                MainActivity.this.finish();
                            }
                        }).create();
                dlg.show();
            }
        }).setNeutralButton("退出", new DialogInterface.OnClickListener() {
            
            @Override
            public void onClick(DialogInterface dialog, int which) {
                // TODO Auto-generated method stub
                MainActivity.this.finish();
            }
        }).create();
        dialog.show();
    
    }
}
xml文件
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <TextView  
        android:id="@+id/username"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="20dip"
        android:layout_marginRight="20dip"
        android:text="账号"
        android:gravity="left"
        android:textAppearance="?android:attr/textAppearanceMedium"
    />
      <EditText
          android:id="@+id/myusername"
          android:layout_height="wrap_content"
          android:layout_width="fill_parent"
          android:layout_marginLeft="20dip"
          android:layout_marginRight="20dip"
          android:scrollHorizontally="true"
          android:autoText="false"
          android:capitalize="none"
          android:gravity="fill_horizontal"
          android:textAppearance="?android:attr/textAppearanceMedium"
      />
      <TextView
          android:id="@+id/password"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_marginLeft="20dip"
          android:layout_marginRight="20dip"
          android:text="密码"
          android:gravity="left"
          android:textAppearance="?android:attr/textAppearanceMedium"
      />
      <EditText
          android:id="@+id/mypassword"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_marginLeft="20dip"
          android:layout_marginRight="20dip"
          android:scrollHorizontally="true"
          android:autoText="false"
          android:capitalize="none"
          android:gravity="fill_horizontal"
          android:password="true"
      />
</LinearLayout>




  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值