項(xiàng)目中遇到的一些小問(wèn)題

1intent傳遞list《parcelabe》

Intent intent = new Intent(this, Ams_SelectSiteActivity.class);
intent.putParcelableArrayListExtra("sites", (ArrayList<SiteServicesModel>) sites);
startActivityForResult(intent, type);
發(fā)給
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) {
            //清空承運(yùn)商和司機(jī)
            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系統(tǒng)不能自動(dòng)安裝問(wèn)題解決方法

<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />

3 遇到j(luò)avac錯(cuò)誤時(shí),沒(méi)有任何提示

在AndroidStudio(mac os)的terminal中輸入命令:
./gradlew compileDebug
windows下輸入:

gradlew compileDebugJavaWithJavac
javac.png
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容