title: I cant find the solutin can pls someone
body: <p>I am doing a Note app but my problem ist that</p>
  <pre><code>var id: Int? = 0
  
  override fun onViewCreated(view: View, savedInstanceState: Bundle? ) {
    super.onViewCreated(view, savedInstanceState)
  
    addbt.setOnClickListener {
      var dbManger = DbManger(this!!.requireContext())
      val title = ettittel.text.toString()
      val beschreibung = etbeschreibung.text.toString()
      val values = ContentValues()
      values.put(&quot;Title&quot;, title)
      values.put(&quot;Beschreibung&quot;, beschreibung)
  
      if (id == 0) {
        val id = dbManger.insertNotiz(values)
        if (id &gt; 0) {
          Toast.makeText(this.context, &quot;Text wurde hinzugefügt&quot;, Toast.LENGTH_LONG).show()
        } else {
          Toast.makeText(this.context, &quot;Fehlgeschlagen&quot;, Toast.LENGTH_LONG).show()
        }
      } else {
        val selectionArgs = arrayOf(id.toString())
        val id = dbManger.update(values, &quot;ID=?&quot;, selectionArgs)
        if (id &gt; 0) {
          Toast.makeText(this.context, &quot;Text wurde geändert&quot;, Toast.LENGTH_LONG).show()
        } else {
          Toast.makeText(this.context, &quot;änderung Fehlgeschlagen&quot;, Toast.LENGTH_LONG).show()
        }
      }
    }
  
    setHasOptionsMenu(true)
    val id = arguments?.getInt(&quot;ID&quot;)
    
    if (id != 0) {
      val Title = arguments?.getString(&quot;Title&quot;)
      ettittel.setText(Title)
      val beschreibung = arguments?.getString(&quot;Beschreibung&quot;)
      etbeschreibung.setText(beschreibung)
    }
  
  }
  </code></pre>
  <p>the error is that it never jumps in the else loop so when i want to edit the text it adds the new text every time i try for hours but i couldn't get it i will be very happy about a helpful tip
  thank you very much in advance</p>