package mars.autocomplete;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
public class MainActivity extends Activity {
/** Called when the activity is first created. */
AutoCompleteTextView autoCompleteTextView = null;
static final String[] COUNTRIES = new String[] {
"Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra",
"Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina",
"Armenia", "Aruba", "Australia", "Austria", "Azerbaijan",
"Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium",
"Belize", "Benin", "Bermuda", "Bhutan", "Bolivia",
"Bosnia and Herzegovina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory",
"British Virgin Islands", "Brunei", "Bulgaria", "Burkina Faso", "Burundi",
"Cote d'Ivoire", "Cambodia", "Cameroon", "Canada", "Cape Verde",
"Cayman Islands", "Central African Republic", "Chad", "Chile", "China",
"Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo",
"Cook Islands", "Costa Rica", "Croatia", "Cuba", "Cyprus", "Czech Republic",
"Democratic Republic of the Congo", "Denmark", "Djibouti", "Dominica", "Dominican Republic",
"East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea",
"Estonia", "Ethiopia", "Faeroe Islands", "Falkland Islands", "Fiji", "Finland",
"Former Yugoslav Republic of Macedonia", "France", "French Guiana", "French Polynesia",
"French Southern Territories", "Gabon", "Georgia", "Germany", "Ghana", "Gibraltar",
"Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau",
"Guyana", "Haiti", "Heard Island and McDonald Islands", "Honduras", "Hong Kong", "Hungary",
"Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica",
"Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Kuwait", "Kyrgyzstan", "Laos",
"Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg",
"Macau", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands",
"Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia", "Moldova",
"Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia",
"Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand",
"Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "North Korea", "Northern Marianas",
"Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru",
"Philippines", "Pitcairn Islands", "Poland", "Portugal", "Puerto Rico", "Qatar",
"Reunion", "Romania", "Russia", "Rwanda", "Sqo Tome and Principe", "Saint Helena",
"Saint Kitts and Nevis", "Saint Lucia", "Saint Pierre and Miquelon",
"Saint Vincent and the Grenadines", "Samoa", "San Marino", "Saudi Arabia", "Senegal",
"Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands",
"Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "South Korea",
"Spain", "Sri Lanka", "Sudan", "Suriname", "Svalbard and Jan Mayen", "Swaziland", "Sweden",
"Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "The Bahamas",
"The Gambia", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey",
"Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Virgin Islands", "Uganda",
"Ukraine", "United Arab Emirates", "United Kingdom",
"United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan",
"Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Wallis and Futuna", "Western Sahara",
"Yemen", "Yugoslavia", "Zambia", "Zimbabwe"
};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//通过ID得到AutoCompleteTextView对象
autoCompleteTextView = (AutoCompleteTextView)findViewById(R.id.autocomplete);
//创建一个list,为ArrayAdapter提供数据
List<String> list = new ArrayList<String>();
list.add("测试测试");
list.add("测试test");
//创建一个ArrayAdapter对象
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this,R.layout.list_item,list);
//将ArrayAdapter设置给AutoCompleteTextView对象
autoCompleteTextView.setAdapter(arrayAdapter);
}
}
package mars.download; import mars.utils.HttpDownloader; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class Download extends Activity { /** Called when the activity is first created. */ private Button downloadTxtButton; private Button downloadMp3Button; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); downloadTxtButton = (Button)findViewById(R.id.downloadTxt); downloadTxtButton.setOnClickListener(new DownloadTxtListener()); downloadMp3Button = (Button)findViewById(R.id.downloadMp3); downloadMp3Button.setOnClickListener(new DownloadMp3Listener()); } class DownloadTxtListener implements OnClickListener{ public void onClick(View v) { HttpDownloader httpDownloader = new HttpDownloader(); String lrc = httpDownloader.download("http://192.168.10.1:8080/voa1500/a1.txt"); System.out.println(lrc); } } class DownloadMp3Listener implements OnClickListener{ public void onClick(View v) { // TODO Auto-generated method stub HttpDownloader httpDownloader = new HttpDownloader(); int result = httpDownloader.downFile("http://192.168.10.1:8080/voa1500/a1.mp3", "voa/", "a1.mp3"); System.out.println(result); } } }





























































































































- 1
- 2
- 3
- 4
- 5
- 6
- 7

- #完美解决问题
- #运行顺畅
- #内容详尽
- #全网独家
- #注释完整
- super_Man_52015-11-04一般吧,对我没什么用!
- happyhq2013-03-20不错的资源 但是不是很全 一边下载
- danceastyle2014-02-03不错的资源 但是不是很全 一边下载

- 粉丝: 7
- 资源: 3
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- YOLO_你在咖啡馆.zip
- YOLO_您可以直接导入该模块.zip
- YOLO_你只看一次实时对象检测器.zip
- YOLO_派生自XilinxEdgeAIPlatformTutorials.zip
- YOLO_人生只有一次.zip
- YOLO_让我们.zip
- YOLO_疲劳检测危险驾驶检测.zip
- YOLO_生命周期太短,不适合运行测试.zip
- YOLO_树莓派独立AIpowered相机与实时饲料电子邮件通知和事件触发云存储.zip
- YOLO_使用一个开源训练库轻松训练或微调SOTA计算机视觉模型.zip
- YOLO_网络训练图像预处理以及部分hend功能是基于pc端实现的只有主干网络部署在fpga上片上资源无法支持整个网络.zip
- YOLO_我的文章在GitHub仓库.zip
- YOLO_提供了预训练权重.zip
- YOLO_修复了改进的GitHub.zip
- ucommon-doc-7.0.0-20.el8.x64-86.rpm.tar.gz
- YOLO_旋转bbox检测的灵感来源于.zip


