saving . . . saved STsearchapp closing restart again has been deleted. STsearchapp closing restart again has been hidden .
STsearchapp closing restart again
Title
Question
MainActivity.kt
---------------
package com.example.stsearch

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.widget.AdapterView
import android.widget.ArrayAdapter
import android.widget.Spinner
import android.widget.Toast
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        var fossVsFossID = HashMap<String, Int>()
        fossVsFossID.put("Java",10)
        fossVsFossID.put("Cpp",57)
        fossVsFossID.put("Python",26)
        fossVsFossID.put("RDBMS",92)

        var languageVsLanguageID = HashMap<String, Int>()
        languageVsLanguageID.put("English", 22)
        languageVsLanguageID.put("Hindi", 6)
        languageVsLanguageID.put("Gujarati", 5)
        languageVsLanguageID.put("Tamil", 18)
        languageVsLanguageID.put("Marathi", 12)
        languageVsLanguageID.put("Kannada", 7)

        var fossVsLanguage = HashMap<String, ArrayList<String>>()
        var availableLanguagesForFoss: ArrayList<String>

        availableLanguagesForFoss = arrayListOf("English", "Gujarati","Hindi",  "Kannada")
        fossVsLanguage.put("Java", availableLanguagesForFoss)

        availableLanguagesForFoss = arrayListOf("English", "Gujarati", "Hindi","Kannada", "Marathi", "Tamil")
        fossVsLanguage.put("Cpp", availableLanguagesForFoss)

        availableLanguagesForFoss = arrayListOf("English", "Hindi")
        fossVsLanguage.put("Python", availableLanguagesForFoss)

        availableLanguagesForFoss = arrayListOf("English")
        fossVsLanguage.put("RDBMS", availableLanguagesForFoss)

        var fossSpinner = findViewById<Spinner>(R.id.Spinner1)
        var languageSpinner = findViewById<Spinner>(R.id.Spinner2)

        var fossOptions = fossVsFossID.keys.toList()
        var languageOptions = languageVsLanguageID.keys.toMutableList()

        var selectedFoss = "none"
        var selectedLanguage = "none"
        var fossAdapter = ArrayAdapter<String>(applicationContext, android.R.layout.simple_list_item_activated_1, fossOptions)
        fossSpinner.adapter = fossAdapter

        var languageAdapter = ArrayAdapter<String>(applicationContext, android.R.layout.simple_list_item_activated_1, languageOptions)

        languageSpinner.adapter = languageAdapter

        fossSpinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
            override fun onNothingSelected(parent: AdapterView<*>?) {
            }

            override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {

                languageOptions.clear()

                selectedFoss = fossOptions.get(position)

                languageOptions.addAll(ArrayList(fossVsLanguage.get(selectedFoss)!!))

                languageAdapter.notifyDataSetChanged()
            }
        }

        languageSpinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
            override fun onNothingSelected(parent: AdapterView<*>?) {
            }

            override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {

                selectedLanguage = languageOptions.get(position)
            }
        }

        searchButton.setOnClickListener {
            if (selectedFoss == "none" || selectedLanguage == "none") {

                Toast.makeText(this, "Please select FOSS and Language both", Toast.LENGTH_SHORT).show()

            } else {

                var fossID = fossVsFossID.get(selectedFoss)
                var languageID = languageVsLanguageID.get(selectedLanguage)

                var searchIntent = Intent(this, Main2Activity::class.java).apply {
                    putExtra("fossID", "" + fossID)
                    putExtra("languageID", "" + languageID)
                }
                startActivity(searchIntent)
            }

        }

    }
}
-------------------------------------------------------------------------------

Main2Activity.kt
----------------
package com.example.stsearch

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Toast
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.android.volley.Request
import com.android.volley.Request.*
import com.android.volley.Response
import com.android.volley.toolbox.StringRequest
import com.android.volley.toolbox.Volley
import kotlinx.android.synthetic.main.activity_main2.*
import org.json.JSONArray
import org.json.JSONObject

class Main2Activity : AppCompatActivity() {
    var finalResultsArrayList = ArrayList<VideoItem>()
    lateinit var myAdapter: MyAdapter

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main2)

        var foss = intent.getStringExtra("fossID")
        var language = intent.getStringExtra("languageID")
        selectedOption.text = "Foss ID : " + foss + "\nLanguage ID : " + language

        var myRecyclerView = findViewById<RecyclerView>(R.id.videos_recyclerview)

        myAdapter = MyAdapter(applicationContext, finalResultsArrayList)

        myRecyclerView.layoutManager = LinearLayoutManager(this)
        myRecyclerView.setHasFixedSize(true)
        myRecyclerView.adapter = myAdapter



        val queue = Volley.newRequestQueue(this)
        val url = "https://spoken-tutorial.org/api/get_tutorials/" + foss+ "/" + language


        val stringRequest = StringRequest(Request.Method.GET, url, Response.Listener<String> { response ->

            Toast.makeText(applicationContext,"Received server response!", Toast.LENGTH_SHORT).show()

            extractJsonData(response)

        }, Response.ErrorListener {
            Toast.makeText(applicationContext, "Unable to connect to the server", Toast.LENGTH_SHORT).show()
        })
        Toast.makeText(applicationContext,
            "Contacting Server...", Toast.LENGTH_SHORT).show()
        queue.add(stringRequest)

    }

    private fun extractJsonData(jsonResponse: String) {
        var videosDataArray = JSONArray(jsonResponse)
        var singleVideoJsonObject: JSONObject
        var singleVideoItem: VideoItem
        var i = 0
        var size = videosDataArray.length()

        while (i < size) {
            singleVideoJsonObject = videosDataArray.getJSONObject(i)
            singleVideoItem =
                VideoItem(singleVideoJsonObject.getString("video_id"),
                    singleVideoJsonObject.getString("tutorial_name"),
                    singleVideoJsonObject.getString("tutorial_level"))
            finalResultsArrayList.add(singleVideoItem)
            i++
        }
        println("The parsed videoItems are :")
        finalResultsArrayList.forEach { println(it) }
        myAdapter.notifyDataSetChanged()

    }
}

------------------------------------------------------------------------------------------
ThirdActivity.kt
----------------
package com.example.stsearch

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Toast

class ThirdActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_third)

        var selectedVideoID = intent.getStringExtra("VIDEO_ID")
        var selectedVideoTitle =
            intent.getStringExtra("VIDEO_TITLE")

        Toast.makeText(applicationContext,""+ selectedVideoTitle,
            Toast.LENGTH_SHORT).show()
    }
}

------------------------------------------------------------------------------------------------
MyAdapter.kt
-------------
package com.example.stsearch

import android.content.Context
import android.content.Intent
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.squareup.picasso.Picasso
import kotlinx.android.synthetic.main.my_customlayout.view.*



class MyAdapter
    (val mContext : Context, val videoList : ArrayList<VideoItem>) :
    RecyclerView.Adapter<MyAdapter.MyViewHolder>(){
    class MyViewHolder(itemView : View) : RecyclerView.ViewHolder(itemView)

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyViewHolder {

        val layoutInflator = LayoutInflater.from(parent.context)
        val videoItem = layoutInflator.inflate(R.layout.my_customlayout, parent, false)

        return MyViewHolder(videoItem)
    }
    override fun onBindViewHolder(holder: MyViewHolder, position: Int) {

        var singleVideoItem = videoList.get(position)

        holder.itemView.video_title.text = singleVideoItem.videoTitle
        holder.itemView.video_level.text = "Level : " + singleVideoItem.videoLevel

        Picasso.with(mContext)
            .load("https://i.ytimg.com/vi/"+singleVideoItem.videoId+"/sddefault.jpg")
            .resize(640,360)//640x360   *initially 320x180
            .centerCrop()
            .into(holder.itemView.video_thumbnail)

        holder.itemView.itemLinearLayout.setOnClickListener{

            var playVideoIntent = Intent(mContext, ThirdActivity::class.java).apply {
                putExtra("VIDEO_ID",""+singleVideoItem.videoId)
                putExtra("VIDEO_TITLE",""+singleVideoItem.videoTitle)
                addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
            }

            mContext.startActivity(playVideoIntent)
        }
    }

    override fun getItemCount(): Int {
        return videoList.size
    }

}

--------------------------------------------------------------------------------------------
Run Log file
------------
Run logfile
-----------

06/23 06:33:33: Launching app
$ adb push /home/rsenthilkumar/STsearch/app/build/outputs/apk/debug/app-debug.apk /data/local/tmp/com.example.stsearch
$ adb shell pm install -t -r "/data/local/tmp/com.example.stsearch"
Success
APK installed in 18 s 61 ms
$ adb shell am start -n "com.example.stsearch/com.example.stsearch.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Waiting for process to come online
Connected to process 26355 on device lge-lm_x210-LMX210bcbfde07
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
W/art: Before Android 4.1, method int androidx.appcompat.widget.DropDownListView.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
I/Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: EGL 1.4 QUALCOMM build: Nondeterministic_AU_msm8909_LA.BR.1.2.9_RB1__release_AU (I09d312ff84)
    OpenGL ES Shader Compiler Version: E031.31.00.01
    Build Date: 09/25/17 Mon
    Local Branch:
    Remote Branch: quic/LA.BR.1.2.9_rb1.26
    Local Patches: NONE
    Reconstruct Branch: NOTHING
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 1
I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@d0a84c0 time:2076235
D/ViewRootImpl: Need to measure again cause of requestLayout called between measure and layout
I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@d0a84c0 time:2112300
I/ViewRootImpl: ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl: ViewRoot's Touch Event : ACTION_UP
I/ViewRootImpl: ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl: ViewRoot's Touch Event : ACTION_UP
I/AudioManagerEx: AudioManagerEx created
D/OpenGLRenderer: endAllActiveAnimators on 0x95ed6000 (DropDownListView) with handle 0xaad99c70
I/ViewRootImpl: ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl: ViewRoot's Touch Event : ACTION_UP
I/ViewRootImpl: ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl: ViewRoot's Touch Event : ACTION_UP
D/OpenGLRenderer: endAllActiveAnimators on 0x95ed9800 (DropDownListView) with handle 0xab629cc0
I/ViewRootImpl: ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl: ViewRoot's Touch Event : ACTION_UP
I/AudioManagerEx: AudioManagerEx created
I/Timeline: Timeline: Activity_launch_request id:com.example.stsearch time:2117599
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.stsearch, PID: 26355
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.stsearch/com.example.stsearch.Main2Activity}: java.lang.IllegalStateException: myRecyclerView must not be null
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2763)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2824)
        at android.app.ActivityThread.-wrap12(ActivityThread.java)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1546)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:154)
        at android.app.ActivityThread.main(ActivityThread.java:6351)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:896)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:786)
     Caused by: java.lang.IllegalStateException: myRecyclerView must not be null
        at com.example.stsearch.Main2Activity.onCreate(Main2Activity.kt:33)
        at android.app.Activity.performCreate(Activity.java:6775)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2716)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2824)
        at android.app.ActivityThread.-wrap12(ActivityThread.java)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1546)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:154)
        at android.app.ActivityThread.main(ActivityThread.java:6351)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:896)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:786)
Application terminated.


Android-app-using-Kotlin Display-Search-Result 13-14 min 50-60 sec 23-06-21, 6:47 a.m. Rsenthil_1976

Answers:

Can you specify the tutorial name and timing where you are having the problem?

Have you completed the basic level tutorial without any problem?
23-06-21, 6:40 p.m. NirmalaVenkat
Its already mentioned above.
Tutorial : Android-app-using-Kotlin, Display-Search-Result, 13-14 min, 50-60 sec
24-06-21, 2:03 p.m. Rsenthil_1976

Login to add comment


Tutorial name : Android-app-using-Kotlin   

Tutorial: Display-Search-Result using Recylerview

Timing: 13-14 min



24-06-21, 1:34 p.m. Rsenthil_1976


Yes I have completed 4 tutorials without any problems
24-06-21, 1:35 p.m. Rsenthil_1976


Did you complete the designing of the layout and my_customlayout.xml as shown in the video?

I didn't find any mistakes in the code.

Try this:
Click on the File menu in the menu bar and Select Invalidate Caches/ Restart menu.
Close the project and open it again.


24-06-21, 3:37 p.m. NirmalaVenkat


I tried Invalidate Caches/ Restart menu.
Close the project and open it again.

But its not working, again showing error " Unfortunately STsearch has stopped. Open app again"

For your reference I am pasting the code of my_customlayout.xml :

<pre style="background-color:#ffffff;color:#000000;font-family:'DejaVu Sans Mono';font-size:9.0pt;"><span style="font-style:italic;"><?</span><span style="color:#0000ff;font-weight:bold;">xml version=</span><span style="color:#008000;font-weight:bold;">"1.0" </span><span style="color:#0000ff;font-weight:bold;">encoding=</span><span style="color:#008000;font-weight:bold;">"utf-8"</span><span style="font-style:italic;">?>
</span><<span style="color:#000080;font-weight:bold;">LinearLayout </span><span style="color:#0000ff;font-weight:bold;">xmlns:</span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">=</span><span style="color:#008000;font-weight:bold;">"http://schemas.android.com/apk/res/android"
</span><span style="color:#008000;font-weight:bold;"> </span><span style="color:#0000ff;font-weight:bold;">xmlns:</span><span style="color:#660e7a;font-weight:bold;">app</span><span style="color:#0000ff;font-weight:bold;">=</span><span style="color:#008000;font-weight:bold;">"http://schemas.android.com/apk/res-auto" </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:layout_width=</span><span style="color:#008000;font-weight:bold;">"wrap_content"
</span><span style="color:#008000;font-weight:bold;"> </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:layout_height=</span><span style="color:#008000;font-weight:bold;">"wrap_content" </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:orientation=</span><span style="color:#008000;font-weight:bold;">"vertical" </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:id=</span><span style="color:#008000;font-weight:bold;">"@+id/itemLinearLayout"</span>>
<<span style="color:#000080;font-weight:bold;">ImageView
</span><span style="color:#000080;font-weight:bold;"> </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:layout_width=</span><span style="color:#008000;font-weight:bold;">"match_parent"
</span><span style="color:#008000;font-weight:bold;"> </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:layout_height=</span><span style="color:#008000;font-weight:bold;">"194dp" </span><span style="color:#660e7a;font-weight:bold;">app</span><span style="color:#0000ff;font-weight:bold;">:srcCompat=</span><span style="color:#008000;font-weight:bold;">"@mipmap/ic_launcher" </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:id=</span><span style="color:#008000;font-weight:bold;">"@+id/video_thumbnail"</span>/>
<<span style="color:#000080;font-weight:bold;">TextView
</span><span style="color:#000080;font-weight:bold;"> </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:text=</span><span style="color:#008000;font-weight:bold;">"TextView"
</span><span style="color:#008000;font-weight:bold;"> </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:layout_width=</span><span style="color:#008000;font-weight:bold;">"347dp"
</span><span style="color:#008000;font-weight:bold;"> </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:layout_height=</span><span style="color:#008000;font-weight:bold;">"wrap_content" </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:id=</span><span style="color:#008000;font-weight:bold;">"@+id/video_title"
</span><span style="color:#008000;font-weight:bold;"> </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:textAppearance=</span><span style="color:#008000;font-weight:bold;">"@style/TextAppearance.AppCompat.Display1"</span>/>
<<span style="color:#000080;font-weight:bold;">TextView
</span><span style="color:#000080;font-weight:bold;"> </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:text=</span><span style="color:#008000;font-weight:bold;">"TextView"
</span><span style="color:#008000;font-weight:bold;"> </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:layout_width=</span><span style="color:#008000;font-weight:bold;">"122dp"
</span><span style="color:#008000;font-weight:bold;"> </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:layout_height=</span><span style="color:#008000;font-weight:bold;">"46dp" </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:id=</span><span style="color:#008000;font-weight:bold;">"@+id/video_level" </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:layout_weight=</span><span style="color:#008000;font-weight:bold;">"1"</span>/>
</<span style="color:#000080;font-weight:bold;">LinearLayout</span>>
</pre>
25-06-21, 5:38 a.m. Rsenthil_1976
<pre style="background-color:#ffffff;color:#000000;font-family:'DejaVu Sans Mono';font-size:9.0pt;"><span style="font-style:italic;"><?</span><span style="color:#0000ff;font-weight:bold;">xml version=</span><span style="color:#008000;font-weight:bold;">"1.0" </span><span style="color:#0000ff;font-weight:bold;">encoding=</span><span style="color:#008000;font-weight:bold;">"utf-8"</span><span style="font-style:italic;">?>
</span><<span style="color:#000080;font-weight:bold;">LinearLayout </span><span style="color:#0000ff;font-weight:bold;">xmlns:</span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">=</span><span style="color:#008000;font-weight:bold;">"http://schemas.android.com/apk/res/android"
</span><span style="color:#008000;font-weight:bold;"> </span><span style="color:#0000ff;font-weight:bold;">xmlns:</span><span style="color:#660e7a;font-weight:bold;">app</span><span style="color:#0000ff;font-weight:bold;">=</span><span style="color:#008000;font-weight:bold;">"http://schemas.android.com/apk/res-auto" </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:layout_width=</span><span style="color:#008000;font-weight:bold;">"wrap_content"
</span><span style="color:#008000;font-weight:bold;"> </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:layout_height=</span><span style="color:#008000;font-weight:bold;">"wrap_content" </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:orientation=</span><span style="color:#008000;font-weight:bold;">"vertical" </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:id=</span><span style="color:#008000;font-weight:bold;">"@+id/itemLinearLayout"</span>>
<<span style="color:#000080;font-weight:bold;">ImageView
</span><span style="color:#000080;font-weight:bold;"> </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:layout_width=</span><span style="color:#008000;font-weight:bold;">"match_parent"
</span><span style="color:#008000;font-weight:bold;"> </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:layout_height=</span><span style="color:#008000;font-weight:bold;">"194dp" </span><span style="color:#660e7a;font-weight:bold;">app</span><span style="color:#0000ff;font-weight:bold;">:srcCompat=</span><span style="color:#008000;font-weight:bold;">"@mipmap/ic_launcher" </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:id=</span><span style="color:#008000;font-weight:bold;">"@+id/video_thumbnail"</span>/>
<<span style="color:#000080;font-weight:bold;">TextView
</span><span style="color:#000080;font-weight:bold;"> </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:text=</span><span style="color:#008000;font-weight:bold;">"TextView"
</span><span style="color:#008000;font-weight:bold;"> </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:layout_width=</span><span style="color:#008000;font-weight:bold;">"347dp"
</span><span style="color:#008000;font-weight:bold;"> </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:layout_height=</span><span style="color:#008000;font-weight:bold;">"wrap_content" </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:id=</span><span style="color:#008000;font-weight:bold;">"@+id/video_title"
</span><span style="color:#008000;font-weight:bold;"> </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:textAppearance=</span><span style="color:#008000;font-weight:bold;">"@style/TextAppearance.AppCompat.Display1"</span>/>
<<span style="color:#000080;font-weight:bold;">TextView
</span><span style="color:#000080;font-weight:bold;"> </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:text=</span><span style="color:#008000;font-weight:bold;">"TextView"
</span><span style="color:#008000;font-weight:bold;"> </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:layout_width=</span><span style="color:#008000;font-weight:bold;">"122dp"
</span><span style="color:#008000;font-weight:bold;"> </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:layout_height=</span><span style="color:#008000;font-weight:bold;">"46dp" </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:id=</span><span style="color:#008000;font-weight:bold;">"@+id/video_level" </span><span style="color:#660e7a;font-weight:bold;">android</span><span style="color:#0000ff;font-weight:bold;">:layout_weight=</span><span style="color:#008000;font-weight:bold;">"1"</span>/>
</<span style="color:#000080;font-weight:bold;">LinearLayout</span>>
</pre>
25-06-21, 5:39 a.m. Rsenthil_1976
And also Run log file:
----------------------------
Connected to process 2738 on device lge-lm_x210-LMX210bcbfde07
Application terminated.

logcat file:
-------------
2021-06-25 05:39:37.781 3041-4393/? I/ActivityManager: Start proc 5780:com.google.android.videos/u0a211 for broadcast com.google.android.videos/androidx.work.impl.background.systemalarm.RescheduleReceiver
2021-06-25 05:39:38.773 5780-5780/? V/MediaRouter: Adding route: RouteInfo{ name=Phone, description=null, status=null, category=RouteCategory{ name=null types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO  groupable=false }, supportedTypes=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO , presentationDisplay=null }
2021-06-25 05:39:38.786 5780-5780/? V/MediaRouter: Selecting route: RouteInfo{ name=Phone, description=null, status=null, category=RouteCategory{ name=null types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO  groupable=false }, supportedTypes=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO , presentationDisplay=null }
2021-06-25 05:39:38.835 3041-11119/? D/ConnectivityService: app name = com.google.android.videos
2021-06-25 05:39:38.835 3041-11119/? D/ConnectivityService: app name = com.google.android.videos package name = com.google.android.videos
2021-06-25 05:39:39.095 5780-5780/? V/MediaRouter: Selecting route: RouteInfo{ name=Phone, description=null, status=null, category=RouteCategory{ name=null types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO  groupable=false }, supportedTypes=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO , presentationDisplay=null }
2021-06-25 05:39:39.304 5780-5902/? W/VideoCapabilities: Unsupported mime video/mjpg
2021-06-25 05:39:39.314 5780-5902/? W/VideoCapabilities: Unsupported mime video/theora
2021-06-25 05:39:39.410 5780-5902/? W/VideoCapabilities: Unsupported mime video/mp4v-esdp
2021-06-25 05:39:39.421 5780-5902/? W/VideoCapabilities: Unsupported mime video/mp4v-esdp
2021-06-25 05:39:39.456 5780-5902/? I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
2021-06-25 05:39:40.497 5830-5842/? I/Finsky: [20391] dlr.a(7): Received content filters request from com.google.android.videos
2021-06-25 05:39:41.967 5871-5871/? V/MediaRouter: Adding route: RouteInfo{ name=Phone, description=null, status=null, category=RouteCategory{ name=null types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO  groupable=false }, supportedTypes=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO , presentationDisplay=null }
2021-06-25 05:39:41.983 5871-5871/? V/MediaRouter: Selecting route: RouteInfo{ name=Phone, description=null, status=null, category=RouteCategory{ name=null types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO  groupable=false }, supportedTypes=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO , presentationDisplay=null }
2021-06-25 05:39:42.087 5871-5871/? V/MediaRouter: Selecting route: RouteInfo{ name=Phone, description=null, status=null, category=RouteCategory{ name=null types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO  groupable=false }, supportedTypes=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO , presentationDisplay=null }
2021-06-25 05:39:47.234 3041-4345/? I/ActivityManager: Killing 5780:com.google.android.videos/u0a211 (adj 906): empty #11
2021-06-25 05:42:25.535 3909-3909/? I/VideoQualityHandler: onReceive = android.intent.action.CLOSE_SYSTEM_DIALOGSnull

25-06-21, 5:43 a.m. Rsenthil_1976
Any error in my_customlayout.xml 
28-06-21, 8:07 p.m. Rsenthil_1976

Login to add comment


Please check this whether dependencies are added or not.

Right click on app --> Open Module Settings --> Dependencies then on right side click on plus button. Add library dependency and search recyclerview and then add it.

Close the project and open it again.

What is your RAM size of our machine? Minimum 8 GB is required.

I read the below message in google when I searched for 'Application terminated' error.
Android will terminate the process when Android decides to do so, usually because it is running low on system RAM.
29-06-21, 1:44 p.m. NirmalaVenkat


Log-in to answer to this question.