how to pass data between screens using intent in MIT app inventor

Pavan tej picture Pavan tej · Jan 10, 2015 · Viewed 25.9k times · Source

I am a beginner in MIT app inventor tool. I am stuck on passing data between screens. I have searched a lot of time on the internet. I got lots of results using activity starter with intent, but how it is possible in MIT app inventor?

If in android we can pass data like this

Intent i = new Intent(this, ActivityTwo.class);

i.putExtra("Value1", "This value one for ActivityTwo ");

i.putExtra("Value2", "This value two ActivityTwo");

startActivity(i);   

by using bundle we get that data, but how it is possible in MIT app inventor?

Answer

Taifun picture Taifun · Jan 10, 2015

You have 2 options to pass data between screens:

  1. to use the open another screen with start value block
    example: enter image description here as you can see, a value also can be a list...
    then in the other screen you can get the data using the get start value block

  2. to use TinyDB
    for example in Screen1 just store the data in TinyDB and read it again in Screen2

see also this example