1intent传递list《parcelabe》
Intent intent = new Intent(this, Ams_SelectSiteActivity.class);
intent.putParcelableArrayListExtra("sites", (ArrayList<SiteServicesModel>) sites);
startActivityForResult(intent, type);
发给
List<SiteServicesModel> sites = intent.getParcelableArrayListExtra("sites");
2 给spiner选中文字后改变颜色
sp_vehicle.setAdapter(new ArrayAdapter<String>(this,R.layout.ams_item_spinner_text_wight,R.id.tv_ordertype,vehicleData));
sp_vehicle.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
//清空承运商和司机
TextView tv = (TextView) view.findViewById(R.id.tv_ordertype);
tv.setTextColor(ContextCompat.getColor(Ams_PayableInputActivity.this,R.color.white));
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
安卓8.0系统不能自动安装问题解决方法
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
3 遇到javac错误时,没有任何提示
在AndroidStudio(mac os)的terminal中输入命令:
./gradlew compileDebug
windows下输入: