If I click Activity-3 Back Button then Its going to Activity-1 instead of Activity-2. I am not sure what's wrong in the Manifest file.Error If I click the Back Button.
Below is the Error code from the Activity Page 2. Recycler view is working fine if I click the item. Only backward is the issue now.
Found the Issue. The Variable from Activity3 to Activity2 is null so thats why Its going to Activity1.
Activity:3
TestMenuDetail:
val navBarTitle2=intent.getStringExtra(TestMenuViewHolder.TEST_TITLE_NAME)
val TestVar=Intent(this@TestMenuDetail,TestMenuList::class.java)
intent.putExtra("TestVar",navBarTitle2)
Activity:2
TestMenuList:
val navBarTitle3=intent.getStringExtra("TestVar")
println("Helllo Test: $navBarTitle3")
Process: TestProject, PID: 28725
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was NUMBER at line 1 column 2 path $
at com.google.gson.Gson.fromJson(Gson.java:939)
at com.google.gson.Gson.fromJson(Gson.java:892)
at com.google.gson.Gson.fromJson(Gson.java:841)
at com.google.gson.Gson.fromJson(Gson.java:813)
at TestProject.TestMenuList$fetchJSON$1.onResponse(TestMenuList.kt:50)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:153)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was NUMBER at line 1 column 2 path $
at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350)
at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:70)
at com.google.gson.Gson.fromJson(Gson.java:927)
at com.google.gson.Gson.fromJson(Gson.java:892)
at com.google.gson.Gson.fromJson(Gson.java:841)
at com.google.gson.Gson.fromJson(Gson.java:813)
at TestProject.TestMenuList$fetchJSON$1.onResponse(TestMenuList.kt:50)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:153)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Android Manifest.XML
Activity:1
<activity
android:name="TestProject.ItemDetailActivity3"
android:label="Item Price"
android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="TestProject.WelcomeActivity" />
</activity>
Activity:2
<activity
android:name="TestProject.TestMenuList"
android:label="Test Menu"
android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="TestProject.ItemDetailActivity3" />
</activity>
Activity:3
<activity android:name="TestProject.TestMenuDetail"
android:label="Test List Detail"
android:screenOrientation="portrait" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="TestProject.TestMenuList" />
</activity>