Use of intent component to transfer text value between different activities

it’s very essential to transfer value between different activities.for example we create a text database to use main_xml page and use it.

sometimes the database which created in main_xml page same database require to use another xml page.we create again same database.but here is one more way to use same database without create again.

Follow this simple steps to use single database in different xml_page…

you can handle this process by using two blocks

  1. intent put extra key
  2. get extra key

  • Create two xml page and named as you want. for example main.xml and page2.xml

  • After that in main.xml create a text view and set text as you want
  • Also create a button for jump between different pages

  • than go to component section and add intent component named anything

  • Than go event section and tap in on button click

  • after that you will see like below

  • In when button click block drog and drop intent block set screen
  • Than drog and drop put extra key and strat activity

  • After that put any key and value set as get_text block and select textview

  • Than go to page2.xml create a textview
  • After that go to event section and select oncreate
  • drog and drop set text block and in string value use activity get extra key block

  • set string value in activity extra key same as put extra key string value
  • Run your project

Watch in the video

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.