I’m trying to make an android app, where when you scan a QR code, the contains of the app will change. But how to do that? [closed]

Each qr code that the app scans is supposed to give different contains in the app. For example:

Without scan:
List: [Empty]

QR1 :
List:

  • Carrots
  • Milk
  • Chocolate

QR2 :
List:

  • Milk

QR3 :
List:

  • Chocolate
  • Detergant

I tried making the QR code decode into an alert, but I can’t really change the contains of the app