0

I dont want to spam you guys with that but I got told it's not clear what I want so I tried to edit The post to make it more clear. I tried this 1 month ago and didn't figure out what the problem is. Meanwhile I did 2 courses, read 4 books and did hours of research on the internet. The spinner in my database is not working. still. please help me. I have an Entry-Form in MainActivity, what I want to save in Database. I also have a DatabaseHelper, an AddActivity, CustomAdapter, UpdateActivity, Update.xml and an array.xml. I decided (because it is still not clear) to add the classes all. Please tell me if that is not ok. I am desperate and try to learn all myself and it looks like whatever I do, I do it wrong. Main Problem is in the CustomAdapter, AddActivity and the MainActivity. I can do all I find on the Internet and learned there is still so much wrong lol. I post this Activities for now. I hope someone can give me a hint. I struggle badly with my database since so long. I am sorry for the probably easy problem but I only code since a few months and have nobody to ask. please I need you.

MainActivity

package com.test.app;

public class MainActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener {
    TextView Date, Time1, Time2, ratingBar;
    EditText Building, House, Sun_Moon, weather, Sunrise, Sunset, Temp1, Temp2, Baro, Baro2, Speed, Humidity, Features, Forcast, Notes;
    Button btn_submit;
    Spinner spinner;

    @SuppressLint("WrongViewCast")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Building = findViewById(R.id.Building);
        House = findViewById(R.id.House);
        Date = findViewById(R.id.Date);
        Time1 = findViewById(R.id.Time1);
        Time2 = findViewById(R.id.Time2);
        Sun_Moon = findViewById(R.id.Sun_Moon);
        Sunrise = findViewById(R.id.Sunrise);
        Sunset = findViewById(R.id.Sunset);
        spinner = findViewById(R.id.spinner);
        weather = findViewById(R.id.weather);
        Temp1 = findViewById(R.id.Temp1);
        Temp2 = findViewById(R.id.Temp2);
        Baro = findViewById(R.id.Baro);
        Baro2 = findViewById(R.id.Baro2);
        Speed = findViewById(R.id.Speed);
        Humidity = findViewById(R.id.Humidity);
        Features = findViewById(R.id.features);
        Forcast = findViewById(R.id.Forcast);
        ratingBar = findViewById(R.id.ratingBar);
        Notes = findViewById(R.id.Notes);

        btn_submit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                com.test.app.DatabaseHelper myDB = new com.test.app.DatabaseHelper(MainActivity.this);
                myDB.addHunt(Building.getText().toString().trim(),
                        Date.getText().toString().trim(),
                        Time1.getText().toString().trim(),
                        Time2.getText().toString().trim(),
                        Sunrise.getText().toString().trim(),
                        Sunset.getText().toString().trim(),
                        spinner.getSelectedItem().toString(),
                        Double.parseDouble(Temp1.getText().toString().trim()),
                        Double.parseDouble(Temp2.getText().toString().trim()),
                        Double.parseDouble(Baro.getText().toString().trim()),
                        Double.parseDouble(Baro2.getText().toString().trim()),
                        Integer.parseInt(Humidity.getText().toString().trim()),
                        Features.getText().toString().trim(),
                        Forcast.getText().toString().trim(),
                        ratingBar.getText().toString().trim(),
                        Notes.getText().toString().trim(),
                        Integer.parseInt(Speed.getText().toString().trim()));
            });
        )

            //Initialize and Assign Variable


            final Calendar calendar = Calendar.getInstance();
            String currentDate = DateFormat.getDateInstance(DateFormat.DATE_FIELD).format(calendar.getTime());
            SimpleDateFormat format = new SimpleDateFormat("HH:mm");
            final String time = format.format(calendar.getTime());

            TextView textViewDate = findViewById(R.id.Date);
    textViewDate.setText(currentDate);


            TextView textView = findViewById(R.id.Time1);
    textView.setText(time);

            Spinner spinner = findViewById(R.id.spinner);
            ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, R.array.MoonPhases);
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    spinner.setAdapter(adapter);
    spinner.setOnItemSelectedListener(this);

            final TextView textView1 = findViewById(R.id.Time2);
            Button button = findViewById(R.id.btn_submit);

    button.setOnClickListener(new View.OnClickListener()

            {
                @Override
                public void onClick (View v){
                Calendar calendar1 = Calendar.getInstance();
                SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss");
                String Time1 = format.format(calendar1.getTime());

                textView1.setText(time);
            }


            }

            @Override
            public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
                String text = parent.getItemAtPosition(position).toString();
                Toast.makeText(parent.getContext(), text, Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onNothingSelected(AdapterView<?> parent) {

            }


        });
    }
}

CustomAdapter

public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.MyViewHolder> {

private Context context;
private Activity activity;
private ArrayList id, Building, Date, Time1, Time2,
        Sunrise, Sunset, Spinner, Temp1, Temp2,
        Baro, Baro2, Speed, Humidity, Features,
        Forcast, ratingBar, Notes;

CustomAdapter(Activity activity, Context context, ArrayList<String> id, ArrayList<String> Building,
              ArrayList<String> Date, ArrayList<String> Time1,
              ArrayList<String> Time2, ArrayList<String> Sunrise, ArrayList<String> Sunset,
              ArrayList<String> Spinner, ArrayList<String> Temp1, ArrayList<String> Temp2,
              ArrayList<String> Baro, ArrayList<String> Baro2, ArrayList<String> Speed,
              ArrayList<String> Humidity, ArrayList<String> Features, ArrayList<String> Forcast,
              ArrayList<String> ratingBar, ArrayList<String> Notes){
    this.activity = activity;
    this.context = context;
    this.id = id;
    this.Building = Building;
    this.Date = Date;
    this.Time1 = Time1;
    this.Time2 = Time2;
    this.Sunrise = Sunrise;
    this.Sunset = Sunset;
    this.Spinner = Spinner;
    this.Temp1 = Temp1;
    this.Temp2 = Temp2;
    this.Baro = Baro;
    this.Baro2 = Baro2;
    this.Speed = Speed;
    this.Humidity = Humidity;
    this.Features = Features;
    this.Forcast = Forcast;
    this.ratingBar = ratingBar;
    this.Notes = Notes;
}

@NonNull
@Override
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
    LayoutInflater inflater = LayoutInflater.from(context);
    View view = inflater.inflate(R.layout.my_row, parent, false);
    return new MyViewHolder(view);
}

@RequiresApi(api = Build.VERSION_CODES.M)
@Override
public void onBindViewHolder(@NonNull final MyViewHolder holder, final int position) {
    holder.Date.setText(String.valueOf(Date.get(position)));
    holder.Building.setText(String.valueOf(Building.get(position)));
    holder.Time1.setText(String.valueOf(Time1.get(position)));
    holder.Time2.setText(String.valueOf(Time2.get(position)));
    holder.Sunrise.setText(String.valueOf(Sunrise.get(position)));
    holder.Sunset.setText(String.valueOf(Sunset.get(position)));
    holder.Spinner.setText(String.valueOf(Spinner.get(position)));
    holder.Temp1.setText(String.valueOf(Temp1.get(position)));
    holder.Temp2.setText(String.valueOf(Temp2.get(position)));
    holder.Baro.setText(String.valueOf(Baro.get(position)));
    holder.Baro2.setText(String.valueOf(Baro2.get(position)));
    holder.Speed.setText(String.valueOf(Speed.get(position)));
    holder.Humidity.setText(String.valueOf(Humidity.get(position)));
    holder.Features.setText(String.valueOf(Features.get(position)));
    holder.Forcast.setText(String.valueOf(Forcast.get(position)));
    holder.ratingBar.setText(String.valueOf(ratingBar.get(position)));
    holder.Notes.setText(String.valueOf(Notes.get(position)));
    //Recyclerview onClickListener
    holder.mainLayout.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent intent = new Intent(context, com.test.app.UpdateActivity.class);
            intent.putExtra("id", String.valueOf(id.get(position)));
            intent.putExtra("Building", String.valueOf(Building.get(position)));
            intent.putExtra("Date", String.valueOf(Date.get(position)));
            intent.putExtra("Time1", String.valueOf(Time1.get(position)));
            intent.putExtra("timeEnd", String.valueOf(Time2.get(position)));
            intent.putExtra("sunrise", String.valueOf(Sunrise.get(position)));
            intent.putExtra("sunset", String.valueOf(Sunset.get(position)));
            intent.putExtra("moon", String.valueOf(Spinner.get(position)));
            intent.putExtra("temp start", String.valueOf(Temp1.get(position)));
            intent.putExtra("temp end", String.valueOf(Temp2.get(position)));
            intent.putExtra("baro", String.valueOf(Baro.get(position)));
            intent.putExtra("baro end", String.valueOf(Baro2.get(position)));
            intent.putExtra("wind speed", String.valueOf(Speed.get(position)));
            intent.putExtra("humidity", String.valueOf(Humidity.get(position)));
            intent.putExtra("sight/time", String.valueOf(Features.get(position)));
            intent.putExtra("forecast", String.valueOf(Forcast.get(position)));
            intent.putExtra("rating bar", String.valueOf(ratingBar.get(position)));
            intent.putExtra("notes", String.valueOf(Notes.get(position)));
            activity.startActivityForResult(intent, 1);
        }
    });


}

@Override
public int getItemCount() {
    return id.size();
}

class MyViewHolder extends RecyclerView.ViewHolder {

    TextView Date, Time1, Time2, ratingBar;
    EditText Building, Sunrise, Sunset, Temp1, Temp2,
            Baro, Baro2, Speed, Humidity, Features,
            Forcast, Notes;
    Spinner Spinner;

    LinearLayout mainLayout;

    MyViewHolder(@NonNull View itemView) {
        super(itemView);
        Date = itemView.findViewById(R.id.Date);
        ratingBar = itemView.findViewById(R.id.ratingBar);
        Time2 = itemView.findViewById(R.id.Time2);
        mainLayout = itemView.findViewById(R.id.mainLayout);
        //Animate Recyclerview
        Animation translate_anim = AnimationUtils.loadAnimation(context, R.anim.translate_anim);
        mainLayout.setAnimation(translate_anim);
        }

    }

}

AddActivity

public class AddActivity extends AppCompatActivity {

TextView Date, Time1, Time2, ratingBar;
EditText Building, Sunrise, Sunset, Temp1, Temp2, Baro, Baro2, Speed, Humidity, Features, Forcast, Notes;
Button btn_submit;
Spinner spinner;

@SuppressLint("WrongViewCast")
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    Building = findViewById(R.id.Building);
    Date = findViewById(R.id.Date);
    Time1 = findViewById(R.id.Time1);
    Time2 = findViewById(R.id.Time2);
    Sunrise = findViewById(R.id.Sunrise);
    Sunset = findViewById(R.id.Sunset);
    spinner = findViewById(R.id.spinner);
    Temp1 = findViewById(R.id.Temp1);
    Temp2 = findViewById(R.id.Temp2);
    Baro = findViewById(R.id.Baro);
    Baro2 = findViewById(R.id.Baro2);
    Speed = findViewById(R.id.Speed);
    Humidity = findViewById(R.id.Humidity);
    Features = findViewById(R.id.features);
    Forcast = findViewById(R.id.Forcast);
    ratingBar = findViewById(R.id.ratingBar);
    Notes = findViewById(R.id.Notes);
    btn_submit.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            com.test.app.DatabaseHelper myDB = new com.test.app.DatabaseHelper((Context) AddActivity.this);
            myDB.addHunt(Date.getText().toString().trim(),
                    Time1.getText().toString().trim(),
                    Time2.getText().toString().trim(),
                    Sunrise.getText().toString().trim(),
                    Sunset.getText().toString().trim(),
                    spinner.getSelectedItem().toString(),
                    Double.parseDouble(Temp1.getText().toString().trim()),
                    Double.parseDouble(Temp2.getText().toString().trim()),
                    Double.parseDouble(Baro.getText().toString().trim()),
                    Double.parseDouble(Baro2.getText().toString().trim()),
                    Integer.parseInt(Humidity.getText().toString().trim()));
            Features.getText().toString().trim();
            Forcast.getText().toString().trim();
            ratingBar.getText().toString().trim();
            Notes.getText().toString().trim();
            Integer.parseInt(Speed.getText().toString().trim()););
            Features.getText().toString().trim();
            Forcast.getText().toString().trim();
            ratingBar.getText().toString().trim();
            Notes.getText().toString().trim();
            Integer.parseInt(Speed.getText().toString().trim());
        });
    }
}

}

DatabaseHelper

class DatabaseHelper extends SQLiteOpenHelper {

private Context context;
private static final String DATABASE_NAME = "Hunts.db";
private static final int DATABASE_VERSION = 1;

private static final String TABLE_NAME = "new Hunt";
private static final String COLUMN_ID = "_id";
private static final String COLUMN_Building = "Building";
private static final String COLUMN_Date = "Date";
private static final String COLUMN_Time1 = "Time1";
private static final String COLUMN_Time2 = "Time2";
private static final String COLUMN_Sunrise = "Sunrise";
private static final String COLUMN_Sunset = "Sunset";
private static final String COLUMN_spinner = "spinner";
private static final String COLUMN_Temp1 = "Temp1";
private static final String COLUMN_Temp2 = "Temp2";
private static final String COLUMN_Baro = "Baro";
private static final String COLUMN_Baro2 = "Baro2";
private static final String COLUMN_Speed = "Speed";
private static final String COLUMN_Humidity = "Humidity";
private static final String COLUMN_Features = "Features";
private static final String COLUMN_Forcast = "Forcast";
private static final String COLUMN_ratingBar = "ratingBar";
private static final String COLUMN_Notes = "Notes";

DatabaseHelper(@Nullable Context context) {
    super(context, DATABASE_NAME, null, DATABASE_VERSION);
    this.context = context;
}

@Override
public void onCreate(SQLiteDatabase db) {
    String query = "CREATE TABLE " + TABLE_NAME +
            " (" + COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
            COLUMN_Building + " TEXT, " +
            COLUMN_Date + " DATE, " +
            COLUMN_Time1 + " TIME," +
            COLUMN_Time2 + " TIME, " +
            COLUMN_Sunrise + " TEXT, " +
            COLUMN_Sunset + " TEXT, " +
            COLUMN_spinner + " TEXT, " +
            COLUMN_Temp1 + " DOUBLE, " +
            COLUMN_Temp2 + " DOUBLE, " +
            COLUMN_Baro + " DOUBLE, " +
            COLUMN_Baro2 + " DOUBLE, " +
            COLUMN_Speed + " DOUBLE, " +
            COLUMN_Humidity + " PERCENTAGE, " +
            COLUMN_Features + " TEXT, " +
            COLUMN_Forcast + " TEXT, " +
            COLUMN_ratingBar + " TEXT, " +
            COLUMN_Notes + " TEXT, " +

            "";
    db.execSQL(query);
}
@Override
public void onUpgrade(SQLiteDatabase db, int i, int i1) {
    db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
    onCreate(db);
}

void addHunt(String Building, String Date, String Time1, String Time2, String Sunrise, String Sunset,String spinner,
             double Temp1, double Temp2, double Baro, double Baro2, double Speed, int Humidity, String Features,
             String Forcast, String ratingBar,String Notes){
    SQLiteDatabase db = this.getWritableDatabase();
    ContentValues cv = new ContentValues();

    cv.put(COLUMN_Building, Building);
    cv.put(COLUMN_Date, Date);
    cv.put(COLUMN_Time1, Time1);
    cv.put(COLUMN_Time2, Time2);
    cv.put(COLUMN_Sunrise, Sunrise);
    cv.put(COLUMN_Sunset, Sunset);
    cv.put(COLUMN_spinner, spinner);
    cv.put(COLUMN_Temp1, Temp1);
    cv.put(COLUMN_Temp2, Temp2);
    cv.put(COLUMN_Baro, Baro);
    cv.put(COLUMN_Baro2, Baro2);
    cv.put(COLUMN_Speed, Speed);
    cv.put(COLUMN_Humidity, Humidity);
    cv.put(COLUMN_Features, Features);
    cv.put(COLUMN_Forcast, Forcast);
    cv.put(COLUMN_ratingBar, ratingBar);
    cv.put(COLUMN_Notes, Notes);

    long result = db.insert(TABLE_NAME,null, cv);
    if(result == -1){
        Toast.makeText(context, "Failed", Toast.LENGTH_SHORT).show();
    }else {
        Toast.makeText(context, "Added Successfully!", Toast.LENGTH_SHORT).show();
    }
}

Cursor readAllData(){
    String query = "SELECT * FROM " + TABLE_NAME;
    SQLiteDatabase db = this.getReadableDatabase();

    Cursor cursor = null;
    if(db != null){
        cursor = db.rawQuery(query, null);
    }
    return cursor;
}

void updateData(String Building, String Date, String Time1, String Time2, String Sunrise, String Sunset,String spinner,
                double Temp1, double Temp2, double Baro, double Baro2, double Speed, int Humidity, String Features,
                String Forcast, String ratingBar,String Notes){
    SQLiteDatabase db = this.getWritableDatabase();
    ContentValues cv = new ContentValues();
    cv.put(COLUMN_Building, Building);
    cv.put(COLUMN_Date, Date);
    cv.put(COLUMN_Time1, Time1);
    cv.put(COLUMN_Time2, Time2);
    cv.put(COLUMN_Sunrise, Sunrise);
    cv.put(COLUMN_Sunset, Sunset);
    cv.put(COLUMN_spinner, spinner);
    cv.put(COLUMN_Temp1, Temp1);
    cv.put(COLUMN_Temp2, Temp2);
    cv.put(COLUMN_Baro, Baro);
    cv.put(COLUMN_Baro2, Baro2);
    cv.put(COLUMN_Speed, Speed);
    cv.put(COLUMN_Humidity, Humidity);
    cv.put(COLUMN_Features, Features);
    cv.put(COLUMN_Forcast, Forcast);
    cv.put(COLUMN_ratingBar, ratingBar);
    cv.put(COLUMN_Notes, Notes);

    long result = db.update(TABLE_NAME, cv, "_id=?", new String[]{Date});
    if(result == -1){
        Toast.makeText(context, "Failed", Toast.LENGTH_SHORT).show();
    }else {
        Toast.makeText(context, "Updated Successfully!", Toast.LENGTH_SHORT).show();
    }

}

void deleteOneRow(String row_id){
    SQLiteDatabase db = this.getWritableDatabase();
    long result = db.delete(TABLE_NAME, "_id=?", new String[]{row_id});
    if(result == -1){
        Toast.makeText(context, "Failed to Delete.", Toast.LENGTH_SHORT).show();
    }else{
        Toast.makeText(context, "Successfully Deleted.", Toast.LENGTH_SHORT).show();
    }
}

void deleteAllData(){
    SQLiteDatabase db = this.getWritableDatabase();
    db.execSQL("DELETE FROM " + TABLE_NAME);
}

}

UpdateActivity

public class UpdateActivity extends AppCompatActivity {

TextView Date, Time1, Time2, ratingBar;
EditText Building, Sunrise, Sunset, Temp1, Temp2, Baro, Baro2, Speed, Humidity, Features, Forcast, Notes;
Button btn_submit;
Spinner spinner;
String Building_input, Date_input, Time1_input, Time2_input, Sunrise_input, Sunset_input,
        spinner_input, Temp1_input, Temp2_input, Baro_input, Baro2_input, Speed_input, Humidity_input,
        Feature_input, Forcast_input, ratingBar_input, Notes_input;

@SuppressLint("WrongViewCast")
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_update);

    Building = findViewById(R.id.Building);
    Date = findViewById(R.id.Date);
    Time1 = findViewById(R.id.Time1);
    Time2 = findViewById(R.id.Time2);
    Sunrise = findViewById(R.id.Sunrise);
    Sunset = findViewById(R.id.Sunset);
    spinner = findViewById(R.id.spinner);
    Temp1 = findViewById(R.id.Temp1);
    Temp2 = findViewById(R.id.Temp2);
    Baro = findViewById(R.id.Baro);
    Baro2 = findViewById(R.id.Baro2);
    Speed = findViewById(R.id.Speed);
    Humidity = findViewById(R.id.Humidity);
    Features = findViewById(R.id.features);
    Forcast = findViewById(R.id.Forcast);
    ratingBar = findViewById(R.id.ratingBar);
    Notes = findViewById(R.id.Notes);

    //First we call this
    getAndSetIntentData();

    //Set actionbar Building after getAndSetIntentData method
    ActionBar ab = getSupportActionBar();
    if (ab != null) {
        ab.setTitle((CharSequence) Date);
    }

    btn_submit.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            //And only then we call this
            DatabaseHelper myDB = new DatabaseHelper(UpdateActivity.this);
            Date.getText().toString().trim(),
                    Time1.getText().toString().trim(),
                    Time2.getText().toString().trim(),
                    Sunrise.getText().toString().trim(),
                    Sunset.getText().toString().trim(),
                    spinner.getSelectedItem().toString(),
                    Double.parseDouble(Temp1.getText().toString().trim()),
                    Double.parseDouble(Temp2.getText().toString().trim()),
                    Double.parseDouble(Baro.getText().toString().trim()),
                    Double.parseDouble(Baro2.getText().toString().trim()),
                    Integer.parseInt(Humidity.getText().toString().trim()));
            Features.getText().toString().trim();
            Forcast.getText().toString().trim();
            ratingBar.getText().toString().trim();
            Notes.getText().toString().trim();
            Integer.parseInt(Speed.getText().toString().trim());
        }
    });
    btn_submit.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            confirmDialog();
        }
    });

}

void getAndSetIntentData(){
    if(getIntent().hasExtra("id") && getIntent().hasExtra("Building") &&
            getIntent().hasExtra("House") && getIntent().hasExtra("pages")){
        //Getting Data from Intent
        Building = getIntent().getStringExtra("Building");
        Date = getIntent().getStringExtra("Date");
        Time1 = getIntent().getStringExtra("Time1");
        Time2 = getIntent().getStringExtra("Time2");
        Sunrise = getIntent().getStringExtra("Sunrise");
        Sunset = getIntent().getStringExtra("Sunset");
        spinner = getIntent().getStringExtra("spinner");
        Temp1 = getIntent().getStringExtra("Temp1");
        Temp2 = getIntent().getStringExtra("Temp2");
        Baro = getIntent().getStringExtra("Baro");
        Baro2 = getIntent().getStringExtra("Baro2");
        Speed = getIntent().getStringExtra("Speed");
        Humidity = getIntent().getStringExtra("Humidity");
        Features = getIntent().getStringExtra("Features");
        Forcast = getIntent().getStringExtra("Forcast");
        ratingBar = getIntent().getStringExtra("ratingBar");
        Notes = getIntent().getStringExtra("Notes");


        //Setting Intent Data
        Building_input.setText(Building);
        Date_input.setText(Date);
        Time1_input.setText(Time1);
        Time2_input.setText(Time2);
        Sunrise_input.setText(Sunrise);
        Sunset_input.setText(Sunset);
        spinner_input.setText(spinner);
        Temp1_input.setText(Temp1);
        Temp2_input.setText(Temp2);
        Baro_input.setText(Baro);
        Baro2_input.setText(Baro2);
        Speed_input.setText(Speed);
        Humidity_input.setText(Humidity);
        Feature_input.setText(Features);
        Forcast_input.setText(Forcast);
        ratingBar_input.setText(ratingBar);
        Notes_input.setText(Notes);


        Log.d("stev", Building+" "+Date+" "+Time1+" "+Time2+" "+Sunrise+" "+Sunset+" "+spinner+" "+Temp1+" "+Temp2+
                " "+Baro+" "+Baro2+" "+Speed+" "+Humidity+" "+Features+" "+Forcast+" "+ratingBar+" "+Notes+" ");
    }else{
        Toast.makeText(this, "No data.", Toast.LENGTH_SHORT).show();
    }
}

void confirmDialog(){
    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.setTitle("Delete " + Date + " ?");
    builder.setMessage("Are you sure you want to delete " + Date + " ?");
    builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            DatabaseHelper myDB = new DatabaseHelper(UpdateActivity.this);
            myDB.deleteOneRow(Date);
            finish();
        }
    });
    builder.setNegativeButton("No", new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialogInterface, int i) {

        }
    });
        builder.create().show();
    }
}

So you probably want to know where the red areas are? UpdateActivity: void getAndSetIntentData (kinda all the getIntent rows and the set text), CustomAdapter: holder.Spinner.setText(String.valueOf(Spinner.get(position)));, AddActivity: all the getText().toString().trim() rows, MainActivcity: all the setText, setDropDownViewResource and even the OnClickListener(this one is probably only at the wrong position?). Help to get familiar with my Database is really appreciate. Thanks so much in advance and sorry for the probably stupid mistakes but I am still a Newbie and need to teach all the coding completely myself. Let me struggling a little bit more often.

Thanks so much and I hope it is ok that I added all the activities this time if not tell me and I reduce them again. Have a great day.

KDeutsch
  • 25
  • 5
  • Please read "[How to create a **Minimal**, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example)", and "[What is a debugger and how can it help me diagnose problems?](https://stackoverflow.com/q/25385173/5221149)" or "[How to debug small programs](https://ericlippert.com/2014/03/05/how-to-debug-small-programs/)". – Andreas May 19 '20 at 20:13
  • what behavior are you expecting? It is not clear to me what you want to be done. "Why is my sql database not able to include my spinner?" Do you want to save ur spinners results in ur database?! Do you want to display results from your database in the spinner?! – Henrique Vasconcellos May 19 '20 at 21:11
  • I want to have the spinner result in my database. but android studio is always complaining – KDeutsch Jun 05 '20 at 12:33

0 Answers0