各类监听合集

时间:2020-10-15 15:27:56
【文件属性】:

文件名称:各类监听合集

文件大小:23.22MB

文件格式:RAR

更新时间:2020-10-15 15:27:56

监听

Calendar c = Calendar.getInstance(); int year = c.get(Calendar.YEAR); Object month = c.get(Calendar.MONTH); int day = c.get(Calendar.DAY_OF_MONTH); int hour = c.get(Calendar.HOUR_OF_DAY); int minute = c.get(Calendar.MINUTE); Log.e("time_now", ""+year+"_"+month+1+"_"+day+"_"+hour+"_"+minute); SimpleDateFormat formatter = new SimpleDateFormat ("yyyy年MM月dd日 HH:mm:ss"); Date curDate = new Date(System.currentTimeMillis()); String str10 = formatter.format(curDate); Log.e("time_now1",""+str10); long time=System.currentTimeMillis(); Log.e("time_now2", ""+time); TextView textview1 = (TextView)findViewById(R.id.textview1); textview1.setAutoLinkMask(Linkify.ALL); String linktext = "百度链接 www.baidu.com"; textview1.setText(linktext); //AutoCompleteTextView AutoCompleteTextView autv_1 = (AutoCompleteTextView)findViewById(R.id.autv_1); String[] str = {"ab","abc","abcd"}; ArrayAdapter stringArrayAdapter= new ArrayAdapter(this,android.R.layout.simple_list_item_1,str); autv_1.setAdapter(stringArrayAdapter); //Button 点击 Button btn_1 = (Button)findViewById(R.id.btn_1); btn_1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(MainActivity.this, "按钮点击监听", Toast.LENGTH_SHORT).show(); } });


网友评论