0

Hello I am receiving data from parse SDK in Application class and I have created an ArrayList globally in that class and in my onCreate method I created a query object and trying to receive data and store that data in the ArrayList I have created, Now I want to send the ArrayList which has data to my MainActivity and make use of that data here is my sample code

val streamArray = arrayListOf<String>()

override fun onCreate() {
    super.onCreate()

    Parse.initialize(Parse.Configuration.Builder(this)
            .applicationId("")
            .clientKey("")
            .server("")
            .build()
    )
    val query = ParseQuery<ParseObject>("Stream")
    try {
        val results = query.find()

        for (streamDetail in results) {
            //Log.d("detail", "Stream deail " + streamDetail.getString("detail"))
            streamArray.add(streamDetail.getString("name"))
        }

    } catch (e: ParseException) {
        e.printStackTrace()
    }
}

How can I SEND THE ArrayList to my Main Activity?

vinay kumar
  • 555
  • 1
  • 6
  • 16
  • Possible duplicate of [How do I pass data between Activities in Android application?](https://stackoverflow.com/questions/2091465/how-do-i-pass-data-between-activities-in-android-application) – andrei_zaitcev Jan 05 '18 at 21:39
  • @andrei_zaitcev I want to pass data between one Activity and one Application Class but not two Activities. – vinay kumar Jan 05 '18 at 21:40

0 Answers0