java.lang.nullpointerexception: attempt to invoke virtual method 'java.lang.string java.lang.object.tostring()' on a null object reference how can i solve it please
Terimakasih mas, works perfectly! for someone using fragment, try this: ArrayAdapter arrayAdapter = new ArrayAdapter(getActivity(), R.layout.style_spinner, arrayList); spinner.setAdapter(arrayAdapter);
Menggamil data dari spinner itu, simple kamu buat variabel dulu String vals = spinner.getSelectedItem().toString(); nanti vals dimasukan didalam setValue pada databse firebase : database.child("path").push().setValue(vals);
untuk lebih lanjutnya coba kamu pelajari CRUD firebase, hanya bedanya klo EditText dia di jadikan stringnya : String vals_txt = txtEditText.getText().toString(); sedangkan yang Spinner : String vals_sp = txtSpinner.getSelectedItem().toString();
The requirement to create a spinner to add data is a String array, ListArray and ArrayAdapter, the string array is replaced by a string looped in the item section, then added to the ListArray with arrayList.add (items) and then after completing ListArray adding the data, then the arraylist is inserted into the array adapter, and then the adpter is inserted into the spinner by spinner.setAdapter (arrayAdapter)
You will get this source code, when you finish this tutorial, because with it you can better understand the flow or process in this program when you watch this tutorial.
java.lang.nullpointerexception: attempt to invoke virtual method 'java.lang.string java.lang.object.tostring()' on a null object reference
how can i solve it please
Terimakasih mas, works perfectly!
for someone using fragment, try this:
ArrayAdapter arrayAdapter = new ArrayAdapter(getActivity(), R.layout.style_spinner, arrayList);
spinner.setAdapter(arrayAdapter);
bikin tutorial lanjutan ini buat ambil data dari spinner terus simpan di firebase dong bang...
Menggamil data dari spinner itu, simple
kamu buat variabel dulu String vals = spinner.getSelectedItem().toString();
nanti vals dimasukan didalam setValue pada databse firebase : database.child("path").push().setValue(vals);
untuk lebih lanjutnya coba kamu pelajari CRUD firebase, hanya bedanya klo EditText dia di jadikan stringnya : String vals_txt = txtEditText.getText().toString(); sedangkan yang Spinner : String vals_sp = txtSpinner.getSelectedItem().toString();
@@budyfriend_code kok ini Null ya bang pas saya coba?
sir how can i select an item from this spinner
bang mau nanya, kalau spinner nya mau pakai yg custom bisa gak ya?
kamu bisa liat tutorial ini ruclips.net/video/7MKgq1M0UEA/видео.html
om kalo ambilnya datanya dari sqlite gmna yah..?
ok nanti saya bikin tutorialnya
ruclips.net/video/KCSjbRp8MMw/видео.html
spinner sqlite android studio udh saya buat
@@budyfriend_code Trima Kasih banyak om...
Could you please tell me how to do onclick item in spinner to get the data?
The requirement to create a spinner to add data is a String array, ListArray and ArrayAdapter, the string array is replaced by a string looped in the item section, then added to the ListArray with arrayList.add (items) and then after completing ListArray adding the data, then the arraylist is inserted into the array adapter, and then the adpter is inserted into the spinner by spinner.setAdapter (arrayAdapter)
@@budyfriend_code can you make video on it ?
@@pradnyakumavat5153 you can watch this video
@@budyfriend_code which video for onclick item in spinner to get the data into another activity ?
Omm boleh bagi source code nya
ini dikit loh mas wkwkw, di ketik ulang aja yah, sambil dipelajari juga
thanks a lot
You're welcome
Thank you !
You're welcome
Bro. you save me
Great video, can you provide source code please
You will get this source code, when you finish this tutorial, because with it you can better understand the flow or process in this program when you watch this tutorial.
@@budyfriend_code i create a app , i watch your tutorial , now i want to store this spinner value in firebase please make a video