<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by iWon on Medium]]></title>
        <description><![CDATA[Stories by iWon on Medium]]></description>
        <link>https://medium.com/@quanchat2003?source=rss-72f0064547ba------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_iwQxRb8BxVoHzt3XZWX3w.jpeg</url>
            <title>Stories by iWon on Medium</title>
            <link>https://medium.com/@quanchat2003?source=rss-72f0064547ba------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 21:41:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@quanchat2003/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Use ActivityForResultLuncher as StartActivityForResult() is Deprecated in Android?]]></title>
            <link>https://medium.com/@quanchat2003/test-62a4f85aa8b5?source=rss-72f0064547ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/62a4f85aa8b5</guid>
            <dc:creator><![CDATA[iWon]]></dc:creator>
            <pubDate>Tue, 22 Jul 2025 08:57:56 GMT</pubDate>
            <atom:updated>2025-11-01T15:25:54.217Z</atom:updated>
            <content:encoded><![CDATA[<h3>When is ActivityForResultLuncher called?</h3><p>ActivityForResultLuncher simplifies the work to get the result from another activity by removing the requestcode and the onActivityResult() method which was used earlier with onActivityresult().</p><pre>private val launcher = registerForActivityResult(<br>    ActivityResultContracts.StartActivityForResult()<br>) { result -&gt;<br>    if (result.resultCode == RESULT_OK) {<br>        val data = result.data<br>        tvResult.text = data?.getStringExtra(&quot;result&quot;)<br>    }<br>}</pre><p>Here we see that <strong>registerForActivityResult</strong> takes two parameters. The first defines the type of <strong>action/interaction</strong> needed (ActivityResultContracts) and the second is a callback function where we receive the<strong> result.</strong></p><blockquote>registerForActivityResult() is safe to call before your fragment or activity is created, letting it be used directly when declaring member variables for the returned ActivityResultLauncher instances.</blockquote><blockquote><strong>Note</strong>: You must call <strong>registerForActivityResult</strong>() before the fragment or activity is created, but you can’t launch the ActivityResultLauncher until the fragment or activity’s Lifecycle has reached CREATED</blockquote><p>The ActivityForResultLauncher is called when we call the launch() method on the activity. This method is used to start the other activity to receive a result back from the other activity. It simplifies the process of starting an activity and handling the result, as compared to the traditional approach i.e., startActivityForResult().</p><h3>Steps:</h3><p><strong>1. Initialize ActivityForResultLauncher:</strong> This is typically done in the calling activity’s onCreate() method or any other appropriate initialization method.</p><p><strong>2. Launching an Activity for Result:</strong> Whenever you want to start another activity and receive a result from it, you call the launch() method. You pass an intent that describes the activity you want to start.</p><p><strong>3. The launched activity (NextActivity) is displayed to the user:</strong> The user interacts with this activity according to its functionality.Once the user completes the interaction with the launched activity send a result back to the calling activity, you set the result in the NextActivity and finish the activity.</p><p><strong>4.</strong> Then the callback defined during the initialization of the ActivityResultLauncher is triggered automatically when the NextActivity finishes. This callback receives the result data, and you can use it as needed.</p><p><strong>Activity A calls Activity B for the result:</strong></p><p>MainActivity XML</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>&lt;LinearLayout <br>    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;<br>    xmlns:tools=&quot;http://schemas.android.com/tools&quot;<br>    android:layout_width=&quot;match_parent&quot;<br>    android:layout_height=&quot;match_parent&quot;<br>    android:orientation=&quot;vertical&quot;<br>    tools:context=&quot;.MainActivity&quot;&gt;<br><br>&lt;TextView<br>        android:layout_width=&quot;match_parent&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:text=&quot;Geeks For Geeks&quot;<br>        android:textSize=&quot;50dp&quot;<br>        android:textColor=&quot;@color/black&quot;<br>        android:layout_marginTop=&quot;20dp&quot;<br>        android:gravity=&quot;center&quot;<br>        /&gt;<br>    &lt;TextView<br>        android:id=&quot;@+id/tvResult&quot;<br>        android:layout_width=&quot;match_parent&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:textSize=&quot;30dp&quot;<br>        android:gravity=&quot;center&quot;<br>        android:layout_marginTop=&quot;200dp&quot;<br>        android:text=&quot;Result will show&quot;<br>        /&gt;<br>    &lt;Button<br>        android:id=&quot;@+id/btnResult&quot;<br>        android:layout_width=&quot;250dp&quot;<br>        android:layout_gravity=&quot;center&quot;<br>        android:layout_marginTop=&quot;20dp&quot;<br>        android:textSize=&quot;20dp&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:text=&quot;Get Result&quot; /&gt;<br>&lt;/LinearLayout&gt;</pre><p>MainActivity:</p><pre>package com.example.gfg<br><br>import androidx.activity.result.ActivityResultLauncher<br>import androidx.activity.result.contract.ActivityResultContracts<br>import androidx.appcompat.app.AppCompatActivity<br>import android.content.Intent<br>import android.os.Bundle<br>import android.widget.Button<br>import android.widget.TextView<br><br>class MainActivity : AppCompatActivity() {<br>    <br>    private lateinit var launcher: ActivityResultLauncher&lt;Intent&gt;<br>    private lateinit var btnResult: Button<br>    private lateinit var tvResult: TextView<br>    <br>    override fun onCreate(savedInstanceState: Bundle?) {<br>        super.onCreate(savedInstanceState)<br>        setContentView(R.layout.activity_main)<br>        <br>        btnResult = findViewById(R.id.btnResult)<br>        tvResult = findViewById(R.id.tvResult)<br>        <br>        launcher = registerForActivityResult(<br>            ActivityResultContracts.StartActivityForResult()<br>        ) { result -&gt;<br>            if (result.resultCode == RESULT_OK) {<br>                val data = result.data<br>                tvResult.text = data?.getStringExtra(&quot;result&quot;)<br>            }<br>        }<br>        <br>        btnResult.setOnClickListener {<br>            // This is same as we go one activity to another<br>            val intent = Intent(this@MainActivity, SecondActivity::class.java)<br>            // Rather than calling startActivity(intent) we use this code<br>            launcher.launch(intent)<br>        }<br>    }<br>}</pre><p>SecondActivity XML:</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>&lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;<br>    xmlns:tools=&quot;http://schemas.android.com/tools&quot;<br>    android:layout_width=&quot;match_parent&quot;<br>    android:layout_height=&quot;match_parent&quot;<br>    android:orientation=&quot;vertical&quot;<br>    tools:context=&quot;.SecondActivity&quot;&gt;<br>&lt;TextView<br>        android:id=&quot;@+id/textView&quot;<br>        android:layout_width=&quot;match_parent&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:textSize=&quot;25dp&quot;<br>        android:textColor=&quot;@color/black&quot;<br>        android:gravity=&quot;center&quot;<br>        android:layout_gravity=&quot;center&quot;<br>        android:layout_marginTop=&quot;200dp&quot;<br>        android:text=&quot;GFG&quot; /&gt;<br>    &lt;Button<br>        android:id=&quot;@+id/button&quot;<br>        android:layout_width=&quot;match_parent&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:layout_margin=&quot;20dp&quot;<br>        android:textSize=&quot;25dp&quot;<br>        android:text=&quot;Button&quot; /&gt;<br>  <br>&lt;/LinearLayout&gt;</pre><p>SecondActivity:</p><pre>package com.example.gfg<br><br>import androidx.appcompat.app.AppCompatActivity<br>import android.content.Intent<br>import android.os.Bundle<br>import android.widget.Button<br>import android.widget.TextView<br><br>class SecondActivity : AppCompatActivity() {<br>    <br>    private lateinit var btnSend: Button<br>    private lateinit var text: TextView<br>    <br>    override fun onCreate(savedInstanceState: Bundle?) {<br>        super.onCreate(savedInstanceState)<br>        setContentView(R.layout.activity_second)<br>        <br>        btnSend = findViewById(R.id.button)<br>        text = findViewById(R.id.textView)<br>        <br>        btnSend.setOnClickListener {<br>            val intent = Intent(this@SecondActivity, MainActivity::class.java)<br>            intent.putExtra(&quot;result&quot;, text.text.toString())<br>            setResult(RESULT_OK, intent)<br>            finish()<br>        }<br>    }<br>}</pre><p>Homework for you:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mKcsQfyAl6BfvGqjCuew5A.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62a4f85aa8b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Intent in Kotlin Android Studio (continute …)]]></title>
            <link>https://medium.com/@quanchat2003/understanding-intent-in-kotlin-android-studio-p1-d93237cea963?source=rss-72f0064547ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/d93237cea963</guid>
            <dc:creator><![CDATA[iWon]]></dc:creator>
            <pubDate>Tue, 22 Jul 2025 08:21:10 GMT</pubDate>
            <atom:updated>2025-07-22T09:03:53.111Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BYfVq3iuupkRLqziC4054g.jpeg" /></figure><h3>What is an Intent?</h3><p>An <strong>Intent</strong> in Android is like a message that you send when you want something to happen. It helps one component (like an Activity) talk to another (like another Activity, Service, or even another app).</p><p><strong>Android uses two types of Intents:</strong></p><ul><li><strong>Explicit Intent</strong> (When you know exactly where you want to go)</li><li><strong>Implicit Intent</strong> (When you let the system decide who can handle your request)</li></ul><h3>1. Explicit Intent (Navigating Within Your App)</h3><p>An <strong>Explicit Intent</strong> is used when you know the exact component (Activity, Service, or Broadcast Receiver) that should handle your request. This is commonly used to navigate between different screens of an app.</p><h4>Example: Open a New Activity</h4><p>Let’s say you have two screens: MainActivity and SecondActivity. You can navigate from MainActivity to SecondActivity like this:</p><pre>val intent = Intent(this, SecondActivity::class.java)<br>startActivity(intent)</pre><h4>Passing Data Between Activities</h4><p>Sometimes, you may want to send some data when opening a new screen. Here’s how you can pass data:</p><h4>Sending Data (MainActivity.kt)</h4><p>Where <em>username </em>will be the key and “JohnDoe” will be the value</p><pre>val intent = Intent(this, SecondActivity::class.java)<br>intent.putExtra(&quot;username&quot;, &quot;JohnDoe&quot;)<br>startActivity(intent)</pre><h4>Receiving Data (SecondActivity.kt)</h4><pre>val username = intent.getStringExtra(&quot;username&quot;)<br>Toast.makeText(this, &quot;Hello $username&quot;, Toast.LENGTH_SHORT).show()</pre><p>This will show a toast message: <strong>Hello JohnDoe</strong></p><h3>2. Implicit Intent (Letting the System Handle It)</h3><p>An <strong>Implicit Intent</strong> is used when you don’t specify the exact component to handle the action. Instead, you specify the action you want to perform, and Android looks for an app that can handle it.</p><h4>Example: Open a Webpage in a Browser</h4><pre>val intent = Intent(Intent.ACTION_VIEW, Uri.parse(&quot;https://www.google.com&quot;))<br>startActivity(intent)</pre><h4>Example: Dial a Phone Number</h4><pre>val intent = Intent(Intent.ACTION_DIAL)<br>intent.data = Uri.parse(&quot;tel:+1234567890&quot;)<br>startActivity(intent)</pre><h4>Example: Send an Email</h4><pre>val intent = Intent(Intent.ACTION_SEND)<br>intent.type = &quot;message/rfc822&quot;<br>intent.putExtra(Intent.EXTRA_EMAIL, arrayOf(&quot;example@example.com&quot;))<br>intent.putExtra(Intent.EXTRA_SUBJECT, &quot;Subject&quot;)<br>intent.putExtra(Intent.EXTRA_TEXT, &quot;Hello, this is a test email.&quot;)<br>startActivity(Intent.createChooser(intent, &quot;Send Email via:&quot;))</pre><p>In these examples:</p><ul><li>The system automatically finds the best app (like a browser, phone dialer, or email client) to handle the request.</li><li>If multiple apps can handle the action, the user will see a chooser dialog.</li></ul><h3>3. Intent Filters (Enabling Your App to Handle Intents)</h3><p>If you want your app to be discoverable by other apps using <strong>Implicit Intents</strong>, you need to define an <strong>Intent Filter</strong> in the AndroidManifest.xml.</p><h4>Example: Opening a URL in Your App</h4><p>If you want your app to open https:// links instead of the browser, add this to your AndroidManifest.xml:</p><pre>&lt;activity android:name=&quot;.WebActivity&quot;&gt;<br>    &lt;intent-filter&gt;<br>        &lt;action android:name=&quot;android.intent.action.VIEW&quot; /&gt;<br>        &lt;category android:name=&quot;android.intent.category.DEFAULT&quot; /&gt;<br>        &lt;data android:scheme=&quot;https&quot; /&gt;<br>    &lt;/intent-filter&gt;<br>&lt;/activity&gt;</pre><p>Now, when a user clicks on a link, Android may suggest opening it in your app!</p><h3>4. When to Use Which Intent?</h3><ul><li>Use <strong>Explicit Intents</strong> when you are navigating between activities or starting services <strong>inside</strong> your own app.</li><li>Use <strong>Implicit Intents</strong> when you want to use external apps to perform an action, like opening a webpage, sending an email, or making a call.</li></ul><h4>Conclusion</h4><p>Understanding <strong>Intents</strong> is crucial for building interactive Android applications. Whether you’re switching between screens, opening external apps, or sharing data, knowing when to use <strong>Explicit</strong> vs <strong>Implicit Intents</strong> will help you build better apps.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d93237cea963" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dynamic lists with RecyclerView, DiffUtil, Payload]]></title>
            <link>https://medium.com/@quanchat2003/dynamic-lists-with-recyclerview-diffutil-payload-b424c857f5e1?source=rss-72f0064547ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/b424c857f5e1</guid>
            <dc:creator><![CDATA[iWon]]></dc:creator>
            <pubDate>Sat, 12 Apr 2025 14:39:38 GMT</pubDate>
            <atom:updated>2025-08-07T09:01:36.440Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0ePBQ74L-Xu8O1oy.jpg" /></figure><h3><strong>RecyclerView</strong></h3><h4>What is RecyclerView?</h4><p>Recyclerview is part of of <strong>Android jetpack</strong>. It is a UI component that allows the development to create a scrolling list. It is a ViewGroup used to render the data set with the help of adapter and viewholder. It has various view options like linear, grid and straggerd grid using Viewholder pattern.</p><h4>Major component of RecyclerView :</h4><ul><li><strong>RecylerView.Adapter</strong> : It provide recylerview to bind the data set to each item view.</li><li><strong>Recyclerview.ViewHolder</strong> : It is mandatory to apply over recyclerview to draw the UI for each individual item into list.</li><li><strong>RecyclerView.LayoutManager</strong>: You have many options for view managing into recyclerview like</li></ul><ol><li>For linear data set/ linear view -&gt; Go for LinearLayout Manager</li><li>For Glid data set / grid view -&gt; Go for GlidLayout Manager</li><li>For Custom layout view/ Staggered -&gt; Go for StraggerGlidLayoutManager</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*WGanjD_EvuBIQxL_vfEYnQ.png" /><figcaption><strong>RecyclerView.ItemDecorator</strong> : To decorate each of your view, you can customise your item/ divider etc.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*okqDLCGCLDQG86Jobiod8A.png" /><figcaption><strong>RecylerView.ItemAnimator</strong> : RecyclerView comes up with default animation fetures like when you add new data or delete a item, it will show a very decent animation.</figcaption></figure><p>RecyclerView Methods of RecyclerView.Adapter</p><ul><li>onCreateViewHolder()</li><li>onBindViewHolder()</li><li>getItemCount()</li></ul><h3><strong>How To Use ?</strong></h3><h4>1. Add RecyclerView Library to Project</h4><p>You may need to add the RecyclerView library to your project if it’s not already included. To do that, in Android Studio open the <strong>app-level</strong> <strong>build.gradle</strong> file and add the following code on a new line under the dependency section:</p><pre>implementation &quot;androidx.recyclerview:recyclerview:1.2.1&quot;</pre><p>After that, click the <strong>Sync Now</strong> button so that <a href="https://stackoverflow.com/a/24828666/3475551"><strong>Gradle</strong></a> can sync and download the necessary files for the dependency.</p><h4>2. Add RecyclerView to Layout</h4><p>The RecyclerView also includes a <strong>View</strong> that we’ll add to the layout file for our <strong>MainActivity</strong>. Navigate to <strong>activity_main.xml</strong> (located in <strong>Project/app/src/main/res/layout</strong>) and add the following code inside the parent <strong>ConstraintLayout</strong>:</p><pre>&lt;androidx.recyclerview.widget.RecyclerView<br>        android:id=&quot;@+id/recycler_view&quot;<br>        android:layout_width=&quot;0dp&quot;<br>        android:layout_height=&quot;0dp&quot;<br>        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>        app:layout_constraintEnd_toEndOf=&quot;parent&quot;<br>        app:layout_constraintStart_toStartOf=&quot;parent&quot;<br>        app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;</pre><h4>3. Create Layout For Single Item View</h4><p>Earlier, we mentioned that RecyclerView uses a layout file to define how each data item will look.</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>&lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;<br>    xmlns:tools=&quot;http://schemas.android.com/tools&quot;<br>    android:layout_width=&quot;match_parent&quot;<br>    android:layout_height=&quot;wrap_content&quot;&gt;<br>    &lt;TextView<br>        android:id=&quot;@+id/temperature_tv&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:layout_marginStart=&quot;16dp&quot;<br>        android:layout_marginTop=&quot;16dp&quot;<br>        android:text=&quot;TextView&quot;<br>        android:textSize=&quot;34sp&quot;<br>        app:layout_constraintStart_toStartOf=&quot;parent&quot;<br>        app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;<br>    &lt;TextView<br>        android:id=&quot;@+id/city_tv&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:layout_marginTop=&quot;24dp&quot;<br>        android:text=&quot;TextView&quot;<br>        app:layout_constraintStart_toStartOf=&quot;@+id/temperature_tv&quot;<br>        app:layout_constraintTop_toBottomOf=&quot;@+id/temperature_tv&quot; /&gt;<br>    &lt;TextView<br>        android:id=&quot;@+id/date_tv&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:layout_marginStart=&quot;8dp&quot;<br>        android:text=&quot;TextView&quot;<br>        app:layout_constraintStart_toEndOf=&quot;@+id/city_tv&quot;<br>        app:layout_constraintTop_toTopOf=&quot;@+id/city_tv&quot; /&gt;<br>&lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;</pre><h4>4. Implement ViewHolder Class</h4><p>Once the file is created, open it and replace the content with the following code:</p><pre>class WeatherAdapter(private val weatherReadings: Array&lt;String&gt;) : RecyclerView.Adapter&lt;WeatherAdapter.ViewHolder&gt;() {<br>//Implementation of the ViewHolder Class<br>    class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {<br>        val temperatureTextView: TextView<br>        val cityTextView: TextView<br>        val dateTextView: TextView<br>        init {<br>            temperatureTextView = view.findViewById(R.id.temperature_tv)<br>            cityTextView = view.findViewById(R.id.city_tv)<br>            dateTextView = view.findViewById(R.id.date_tv)<br>        }<br>    }<br>}</pre><h4>5. Implement RecyclerView Adapter</h4><p>Here, we implement the three main methods of the adapter.</p><p>In order to implement the <strong>onCreateViewHolder()</strong> method, add the following code inside the WeatherAdapter class:</p><pre>override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {<br>        // create new view with UI of weather item<br>        val view = LayoutInflater.from(parent.context)<br>            .inflate(R.layout.weather_item, parent, false)<br>        return ViewHolder(view)<br>    }</pre><p>That code inflates our weather item layout into a view and returns a ViewHolder with that view.</p><p>Next, implement the <strong>onBindViewHolder()</strong> method. To do this, add the following code to the WeatherAdapter class:</p><pre>override fun onBindViewHolder(holder: ViewHolder, position: Int) {<br>        //set element from weather data [using position] to TextView<br>        holder.temperatureTextView.text = weatherData[position]<br>    }</pre><p>Now, add the following code for the <strong>getItemCount()</strong> method:</p><pre>override fun getItemCount(): Int {<br>        return weatherData.size<br>    }</pre><p>At this point, we’ve completed the setup for our WeatherAdapter and we can proceed with using it to display data in our app.</p><h4>6. Use Kotlin RecylerView in MainActivity</h4><p>Open the <strong>MainActivity.kt</strong> file and add the following code inside the <strong>onCreate()</strong> method:</p><pre>val recyclerView: RecyclerView = findViewById(R.id.recycler_view)<br>val adapter = WeatherAdapter(arrayOf(&quot;72.2&quot;,&quot;44.6&quot;))<br>recyclerView.layoutManager = LinearLayoutManager(this)<br>recyclerView.adapter = adapter</pre><p>This code creates a new instance of the WeatherAdapter. It also sets a <strong>LayoutManger</strong> for the RecyclerView. We’re using the <strong>LinearLayoutManager</strong>, which offers a vertically scrollable list. And the last line connects our adapter to the RecyclerView from <strong>activity_main.xml</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b424c857f5e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Overview of Activity, Lifecycle, and how to pass data between two screens (using Intent)]]></title>
            <link>https://medium.com/@quanchat2003/overview-of-activity-lifecycle-and-how-to-pass-data-between-two-screens-using-intent-49116f7ee7fe?source=rss-72f0064547ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/49116f7ee7fe</guid>
            <dc:creator><![CDATA[iWon]]></dc:creator>
            <pubDate>Sat, 12 Apr 2025 14:25:07 GMT</pubDate>
            <atom:updated>2025-04-12T14:25:07.218Z</atom:updated>
            <content:encoded><![CDATA[<h3>Native and Platform</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*XSbMGyoKacGSVvPeNJnxcw.png" /></figure><h3>Main components of Activity (4 components)</h3><h3>Activity overview</h3><h3>Activity in android project structure</h3><h3>Activity lifecycle</h3><h3>How to start an Activity ?</h3><h3>How to transfer data between two Activities ?</h3><h3>Activity launch mode</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49116f7ee7fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>