1. Download our Official Android App: Forums for Android!

Logical Flow of App

Discussion in 'Android Development' started by snowman24, Oct 27, 2017.

  1. snowman24

    snowman24 Newbie
    Thread Starter
    Rank:
     #571
    Points:
    25
    Posts:
    17
    Joined:
    Oct 18, 2017

    Oct 18, 2017
    17
    0
    25
    Is it possible to set an adapter for a recyclerview or gridview from a different activity or class other than the one the data is created. For example, while a splash screen is running, have data fetched from a server and put into arraylist, then call an activity thru intent where the data is parsed and the recyclerview adapter is set to the adapter? I have been able to create a recyclerview fetching data and parsing it, but it's all done in one activity. Was hoping to doing the fetching while app loads behind splash screen then depending on a condition, continue to an activity to parse and display or cancel out. I wanted to find out the answer before I started posting a lot of code that made no sense.
    Thanks
     

    Advertisement

  2. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #10
    Points:
    1,988
    Posts:
    8,521
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    8,521
    12,692
    1,988
    Male
    Software developer
    South West of England
    There's nothing wrong with loading your data in parallel with other activities going on. You can do this either by creating a background thread, or starting up a new Activity.
    The way to pass complex data between Activities is to use the Parcelable interface

    https://developer.android.com/reference/android/os/Parcelable.html
     
    snowman24 likes this.

Share This Page

Loading...