How to make my retrofit call appear in recyclerview? - android

I have a problem making my data from rest api call to appear on my recyclerview. There is no error in build and logcat and it can open in emulator fine without any crash and can showing other functions. It just this part recyclerview is not showing any data from retrofit call. I'm trying many tutorials/solutions but none works.
Here is my JSON data, i want to get the name and the quantity of my stock inventory:
13{
"body": [
{
"stock_ID": "1004",
"stock_name": "kobis",
"stock_quantity": "2"
},
{
"stock_ID": "1005",
"stock_name": "bawang",
"stock_quantity": "2"
},
{
"stock_ID": "2001",
"stock_name": "ayam",
"stock_quantity": "4"
},
{
"stock_ID": "2003",
"stock_name": "kambing",
"stock_quantity": "1"
},
{
"stock_ID": "3001",
"stock_name": "kayu manis",
"stock_quantity": "2"
},
{
"stock_ID": "3002",
"stock_name": "lada hitam",
"stock_quantity": "3"
},
{
"stock_ID": "4001",
"stock_name": "minyak",
"stock_quantity": "1"
},
{
"stock_ID": "4002",
"stock_name": "gula",
"stock_quantity": "5"
},
{
"stock_ID": "4003",
"stock_name": "garam",
"stock_quantity": "5"
},
{
"stock_ID": "4004",
"stock_name": "kicap",
"stock_quantity": "4"
},
{
"stock_ID": "4005",
"stock_name": "beras",
"stock_quantity": "3"
},
{
"stock_ID": "5001",
"stock_name": "cawan",
"stock_quantity": "5"
}
],
"inventoryCount": 13
}
My data class (LowStockItem.kt):
data class LowStockList(val items: ArrayList<LowStockItem>)
data class LowStockItem(
val stock_ID: String,
val stock_name: String,
val stock_quantity: String,)
RestApiService.kt:
#GET ("/inventory/read_lowstock.php")
fun getsLowStock(): Call<LowStockList>
RestApiInstance.kt
companion object {
var BASE_URL = "http://roslibiz.com/api/"
fun getRestApiInstance() : Retrofit {
return Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.build()
}
}
LowStockAdapter (Recycler View Adapter):
class LowStockAdapter: RecyclerView.Adapter<LowStockAdapter.MyViewHolder>() {
var items = ArrayList<LowStockItem>()
fun setListData(data: ArrayList<LowStockItem>) {
this.items = data
notifyDataSetChanged()
}
override fun onCreateViewHolder(
parent: ViewGroup,
viewType: Int
): MyViewHolder {
val inflater = LayoutInflater.from(parent.context).inflate(R.layout.low_stock_card, parent, false)
return MyViewHolder(inflater)
}
override fun getItemCount(): Int {
return items.size
}
override fun onBindViewHolder(holder: MyViewHolder, position: Int) {
holder.bind(items[position])
}
class MyViewHolder(view: View): RecyclerView.ViewHolder(view) {
val nama = view.namaLSrv
val id = view.idLSrv
val kuantiti = view.kuantitiLSrv
fun bind(data: LowStockItem){
id.text = data.stock_ID
if(!TextUtils.isEmpty(data.stock_name)){
nama.text = data.stock_name
kuantiti.text = data.stock_quantity
}else{
nama.text = "Nama tiada dalam rekod"
kuantiti.text = "0"
}
}
}
}
MainActivity:
lateinit var recyclerViewAdapter: LowStockAdapter
private fun setupRV(){
lowStockRV.apply {
layoutManager = LinearLayoutManager(this#MainActivity)
recyclerViewAdapter = LowStockAdapter()
adapter = recyclerViewAdapter
val decoration = DividerItemDecoration(applicationContext, VERTICAL)
addItemDecoration(decoration)
}
private fun getLowStock(){
val retroInstance = RestApiInstance.getRestApiInstance().create(RestApiService::class.java)
val call = retroInstance.getsLowStock()
call.enqueue(object: retrofit2.Callback<LowStockList>{
override fun onResponse(call: Call<LowStockList>, response: Response<LowStockList>) {
if (response.isSuccessful){
recyclerViewAdapter.setListData(response.body()?.items!!)
}
}
override fun onFailure(call: Call<LowStockList>, t: Throwable) {
Toast.makeText(this#MainActivity, "Masalah untuk mendapatkan data", Toast.LENGTH_LONG).show()
}
})
}
I'm at my wit end and needs help from other perspectives. Thank you in advance.
EDIT.
this is what i get from debugging and honestly i dont know what to do.
02/24 15:04:25: Launching 'app' on Pixel 2 XL API 30.
Install successfully finished in 688 ms.
$ adb shell am start -n "com.example.roslibusiness/com.example.roslibusiness.ui.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Waiting for application to come online: com.example.roslibusiness.test | com.example.roslibusiness
Waiting for application to come online: com.example.roslibusiness.test | com.example.roslibusiness
Waiting for application to come online: com.example.roslibusiness.test | com.example.roslibusiness
Connecting to com.example.roslibusiness
Connected to the target VM, address: 'localhost:63581', transport: 'socket'
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/e.roslibusines: Not late-enabling -Xcheck:jni (already on)
I/e.roslibusines: Unquickening 12 vdex files!
W/e.roslibusines: Unexpected CPU variant for X86 using defaults: x86
W/ActivityThread: Application com.example.roslibusiness is waiting for the debugger on port 8100...
I/System.out: Sending WAIT chunk
I/System.out: Debugger has connected
waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/chatty: uid=10153(com.example.roslibusiness) identical 5 lines
I/System.out: waiting for debugger to settle...
I/System.out: debugger has settled (1362)
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
I/MultiDex: VM with version 2.1.0 has multidex support
Installing application
VM has multidex support, MultiDex support library is disabled.
D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
W/e.roslibusines: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
W/e.roslibusines: Accessing hidden method Ljava/lang/invoke/MethodHandles$Lookup;-><init>(Ljava/lang/Class;I)V (greylist, reflection, allowed)
W/e.roslibusines: Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (greylist,core-platform-api, reflection, allowed)
Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (greylist,core-platform-api, reflection, allowed)
Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (greylist,core-platform-api, reflection, allowed)
D/CompatibilityChangeReporter: Compat change id reported: 147798919; UID 10153; state: ENABLED
D/HostConnection: HostConnection::get() New Host Connection established 0xea4a3c50, tid 7992
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/EGL_emulation: eglCreateContext: 0xea483f10: maj 3 min 0 rcv 3
D/EGL_emulation: eglMakeCurrent: 0xea483f10: ver 3 0 (tinfo 0xbbc39170) (first time)
I/Gralloc4: mapper 4.x is not supported
D/HostConnection: createUnique: call
HostConnection::get() New Host Connection established 0xea483d50, tid 7992
D/goldfish-address-space: allocate: Ask for block of size 0x100
allocate: ioctl allocate returned offset 0x3fbc17000 size 0x2000
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0
I/OpenGLRenderer: Davey! duration=1136ms; Flags=1, IntendedVsync=9582448914498, Vsync=9582548914494, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=9582554363800, AnimationStart=9582555337800, PerformTraversalsStart=9582555413300, DrawStart=9583238424100, SyncQueued=9583494447900, SyncStart=9583496712300, IssueDrawCommandsStart=9583496796500, SwapBuffers=9583584814100, FrameCompleted=9583588012900, DequeueBufferDuration=571700, QueueBufferDuration=1002300, GpuCompleted=8029250115450508212,
I/Choreographer: Skipped 56 frames! The application may be doing too much work on its main thread.
EDIT: what should i do with this error?
E/RetrofitĀ Error: retrofit2.DefaultCallAdapterFactory$ExecutorCallbackCall#ccab847

You should change the definition of your function setListData
Currently it is this
fun setListData(data: ArrayList<LowStockItem>) {
this.items = data
}
It should be changed to
fun setListData(data: ArrayList<LowStockItem>) {
this.items = data
notifyDataSetChanged()
}
This is a better way of notifying the adapter from within the class.
notifyDataSetChanged() notifies your adapter that data has been changed for use by the RecyclerView, and hence the adapter looks at the new data, and inflates it accordingly.
Also make sure that you are passing the correct data in the adapter.
The retrofit data that you have posted above does not contain the ID field, as declared by you in the class. It might throw some error in that case. As you are in Kotlin, you can use the Android Studio feature to directly convert your json data into an object class, this would help you to create exactly what needs to be used for the successful deserialization. This Android Studio feature is known as Kotlin data class file from JSON and can be found under File -> New.

Problem would be with assigning new instance of List to items, when adapter is holding the different reference, add response to existing list instead of reassigning instance
fun setListData(data: ArrayList<LowStockItem>) {
this.items.clear()
this.items.addAll(data)
}

Related

How do I switch between fragments using the ExpandableBottomBar menu items?

The app starts normal with no fragment and when I click on any of the items in the bottom menu bar the app crashes suddenly. I have used the ExpandableBottomBar github repository to create this bottom bar menu. If you need any more info I will provide. I need help as this is my first app. Thanks!
Here is the Logcat file:
2022-01-07 15:02:13.652 6041-6041/com.psmforums.skillyourself W/re-initialized>: type=1400 audit(0.0:93195): avc: granted { execute } for path="/data/data/com.psmforums.skillyourself/code_cache/startup_agents/a67b7118-agent.so" dev="dm-10" ino=71765 scontext=u:r:untrusted_app:s0:c107,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c107,c257,c512,c768 tclass=file app=com.psmforums.skillyourself
dev_cert_hash: -8472035670327217949
app_store: manual_install
2022-01-07 15:02:13.657 6041-6041/com.psmforums.skillyourself W/s.skillyoursel: DexFile /data/data/com.psmforums.skillyourself/code_cache/.studio/instruments-3e620333.jar is in boot class path but is not in a known location
2022-01-07 15:02:13.665 6041-6041/com.psmforums.skillyourself W/s.skillyoursel: Redefining intrinsic method java.lang.Thread java.lang.Thread.currentThread(). This may cause the unexpected use of the original definition of java.lang.Thread java.lang.Thread.currentThread()in methods that have already been compiled.
2022-01-07 15:02:13.657 6041-6041/com.psmforums.skillyourself V/studio.deploy: No existing instrumentation found. Loading instrumentation from instruments-3e620333.jar
app_instance_id: 92c2e9455736943c0e772cf0035ab296
resettable_device_id: fd0d8f22-9ef2-44a6-b7cb-cebbf2cf7346
ds_id: DSID=AAO-7r5_MpYPzTjAgaC32wDQfkvSzginNg07mmfRIc5rdOjYKQfDMPKbW2npGj0Hsmw-UyiHngI5VghRAR5MZipfG_n7_lhRNKSSV_awotneUkGSDqMFFe8
limited_ad_tracking: false
os_version: 12
2022-01-07 15:02:13.665 6041-6041/com.psmforums.skillyourself W/s.skillyoursel: Redefining intrinsic method boolean java.lang.Thread.interrupted(). This may cause the unexpected use of the original definition of boolean java.lang.Thread.interrupted()in methods that have already been compiled.
device_model: Pixel 6 Pro
user_default_language: en-in
time_zone_offset_minutes: 330
bundle_sequential_index: 78
2022-01-07 15:02:13.668 6041-6041/com.psmforums.skillyourself D/CompatibilityChangeReporter: Compat change id reported: 171979766; UID 10363; state: ENABLED
service_upload: true
health_monitor:
consent_signals: G1--
user_property {
set_timestamp_millis: 1641321205507
name: first_open_time(_fot)
string_value:
int_value: 1641322800000
}
user_property {
set_timestamp_millis: 1641321205507
name: first_open_after_install(_fi)
string_value:
int_value: 1
}
user_property {
set_timestamp_millis: 1641547572273
name: ga_session_number(_sno)
string_value:
int_value: 13
}
user_property {
set_timestamp_millis: 1641547572273
name: ga_session_id(_sid)
string_value:
int_value: 1641547572
}
user_property {
set_timestamp_millis: 1641547933001
name: lifetime_user_engagement(_lte)
string_value:
int_value: 2988248
}
user_property {
set_timestamp_millis: 1641547933001
name: session_user_engagement(_se)
string_value:
int_value: 10722
}
event {
name: screen_view(_vs)
timestamp_millis: 1641547928632
previous_timestamp_millis: 1641547585012
param {
name: ga_event_origin(_o)
string_value: auto
}
param {
name: ga_screen_class(_sc)
string_value: MainActivity
}
param {
name: ga_screen_id(_si)
int_value: -253887690339264981
}
}
event {
name: app_exception(_ae)
timestamp_millis: 1641547932362
previous_timestamp_millis: 1641547587265
param {
name: ga_event_origin(_o)
string_value: clx
}
param {
name: _r
int_value: 1
}
param {
name: engagement_time_msec(_et)
int_value: 3830
}
param {
name: ga_screen_class(_sc)
string_value: MainActivity
}
param {
name: ga_screen_id(_si)
int_value: -253887690339264981
}
param {
name: timestamp
int_value: 1641547931749
}
param {
name: fatal
int_value: 1
}
}
}
}
2022-01-07 15:02:13.613 6041-6041/? I/s.skillyoursel: Late-enabling -Xcheck:jni
2022-01-07 15:02:13.632 6041-6041/? D/ProcessState: Binder ioctl to enable oneway spam detection failed: Invalid argument
2022-01-07 15:02:13.652 6041-6041/com.psmforums.skillyourself W/re-initialized>: type=1400 audit(0.0:93195): avc: granted { execute } for path="/data/data/com.psmforums.skillyourself/code_cache/startup_agents/a67b7118-agent.so" dev="dm-10" ino=71765 scontext=u:r:untrusted_app:s0:c107,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c107,c257,c512,c768 tclass=file app=com.psmforums.skillyourself
2022-01-07 15:02:13.657 6041-6041/com.psmforums.skillyourself W/s.skillyoursel: DexFile /data/data/com.psmforums.skillyourself/code_cache/.studio/instruments-3e620333.jar is in boot class path but is not in a known location
2022-01-07 15:02:13.665 6041-6041/com.psmforums.skillyourself W/s.skillyoursel: Redefining intrinsic method java.lang.Thread java.lang.Thread.currentThread(). This may cause the unexpected use of the original definition of java.lang.Thread java.lang.Thread.currentThread()in methods that have already been compiled.
2022-01-07 15:02:13.665 6041-6041/com.psmforums.skillyourself W/s.skillyoursel: Redefining intrinsic method boolean java.lang.Thread.interrupted(). This may cause the unexpected use of the original definition of boolean java.lang.Thread.interrupted()in methods that have already been compiled.
2022-01-07 15:02:13.668 6041-6041/com.psmforums.skillyourself D/CompatibilityChangeReporter: Compat change id reported: 171979766; UID 10363; state: ENABLED
2022-01-07 15:02:13.887 6041-6041/com.psmforums.skillyourself D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2022-01-07 15:02:13.887 6041-6041/com.psmforums.skillyourself D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2022-01-07 15:02:13.888 6041-6041/com.psmforums.skillyourself D/CompatibilityChangeReporter: Compat change id reported: 1531297613045645771; UID 10363; state: DISABLED
2022-01-07 15:02:13.888 6041-6041/com.psmforums.skillyourself D/CompatibilityChangeReporter: Compat change id reported: 7528921493777479941; UID 10363; state: DISABLED
2022-01-07 15:02:13.917 6041-6041/com.psmforums.skillyourself I/FirebaseApp: Device unlocked: initializing all Firebase APIs for app [DEFAULT]
2022-01-07 15:02:13.952 6041-6041/com.psmforums.skillyourself I/FirebaseCrashlytics: Initializing Firebase Crashlytics 18.2.6 for com.psmforums.skillyourself
2022-01-07 15:02:13.966 6041-6071/com.psmforums.skillyourself I/DynamiteModule: Considering local module com.google.android.gms.measurement.dynamite:55 and remote module com.google.android.gms.measurement.dynamite:59
2022-01-07 15:02:13.966 6041-6071/com.psmforums.skillyourself I/DynamiteModule: Selected remote version of com.google.android.gms.measurement.dynamite, version >= 59
2022-01-07 15:02:13.991 6041-6082/com.psmforums.skillyourself I/FirebaseAuth: [FirebaseAuth:] Preparing to create service connection to fallback implementation
2022-01-07 15:02:14.012 6041-6041/com.psmforums.skillyourself I/FirebaseInitProvider: FirebaseApp initialization successful
2022-01-07 15:02:14.026 6041-6084/com.psmforums.skillyourself D/TransportRuntime.JobInfoScheduler: Upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy1wYS5nb29nbGVhcGlzLmNvbS92MS9maXJlbG9nL2xlZ2FjeS9iYXRjaGxvZ1xBSXphU3lDY2traUg4aTJaQVJ3T3MxTEV6RktsZDE1YU9HOG96S28=) is already scheduled. Returning...
2022-01-07 15:02:14.027 6041-6084/com.psmforums.skillyourself D/TransportRuntime.JobInfoScheduler: Upload for context TransportContext(cct, HIGHEST, MSRodHRwczovL2NyYXNobHl0aWNzcmVwb3J0cy1wYS5nb29nbGVhcGlzLmNvbS92MS9maXJlbG9nL2xlZ2FjeS9iYXRjaGxvZ1xBSXphU3lCcnBTWVQ0RkZMMDlyZUhKaTZIOUZZZGVpU25VVE92Mk0=) is already scheduled. Returning...
2022-01-07 15:02:14.096 6041-6084/com.psmforums.skillyourself D/TransportRuntime.CctTransportBackend: Making request to: https://crashlyticsreports-pa.googleapis.com/v1/firelog/legacy/batchlog
2022-01-07 15:02:14.114 6041-6087/com.psmforums.skillyourself I/FA: App measurement initialized, version: 50018
2022-01-07 15:02:14.114 6041-6087/com.psmforums.skillyourself I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
2022-01-07 15:02:14.114 6041-6087/com.psmforums.skillyourself I/FA: To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app com.psmforums.skillyourself
2022-01-07 15:02:14.114 6041-6087/com.psmforums.skillyourself D/FA: Debug-level message logging enabled
2022-01-07 15:02:14.213 6041-6087/com.psmforums.skillyourself D/FA: Connected to remote service
2022-01-07 15:02:16.337 6041-6084/com.psmforums.skillyourself I/TransportRuntime.CctTransportBackend: Status Code: 200
2022-01-07 15:02:16.337 6041-6084/com.psmforums.skillyourself I/TransportRuntime.CctTransportBackend: Content-Type: application/json; charset=UTF-8
2022-01-07 15:02:16.337 6041-6084/com.psmforums.skillyourself I/TransportRuntime.CctTransportBackend: Content-Encoding: gzip
Here is my MainAcivity.kt file:
import android.graphics.Color
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.ViewGroup
import android.widget.Button
import androidx.fragment.app.Fragment
import com.google.firebase.analytics.FirebaseAnalytics
import com.google.firebase.analytics.ktx.analytics
import com.google.firebase.ktx.Firebase
import com.psmforums.skillyourself.databinding.ActivityMainBinding
import github.com.st235.lib_expandablebottombar.ExpandableBottomBar
import github.com.st235.lib_expandablebottombar.MenuItemDescriptor
import kotlinx.android.synthetic.main.activity_main.*
private lateinit var firebaseAnalytics: FirebaseAnalytics
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
firebaseAnalytics = Firebase.analytics
val bottomBar: ExpandableBottomBar = findViewById(R.id.expandable_bottom_bar)
val menu = bottomBar.menu
menu.add(
MenuItemDescriptor.Builder(this,
R.id.home,
R.drawable.ic_home_foreground,
R.string.homeBtn,
Color.GREEN)
.build()
)
menu.add(
MenuItemDescriptor.Builder
(this,R.id.search,
R.drawable.ic_search_foreground,
R.string.searchBtn,
Color.YELLOW)
.build()
)
menu.add(
MenuItemDescriptor.Builder(this,
R.id.profile,
R.drawable.ic_profile,
R.string.profileBtn,
Color.MAGENTA)
.build()
)
menu.add(
MenuItemDescriptor.Builder(this,
R.id.settings,
R.drawable.ic_settings_foreground,
R.string.settingsBtn,
Color.RED)
.build()
)
bottomBar.onItemSelectedListener = { view, menuItem, Boolean ->
when(menuItem.id){
R.id.home ->
supportFragmentManager.beginTransaction()
.replace(R.id.layout, HomePage())
.commit()
R.id.search ->
supportFragmentManager.beginTransaction()
.replace(R.id.layout, SearchPage())
.commit()
R.id.profile ->
supportFragmentManager.beginTransaction()
.replace(R.id.layout, ProfilePage())
.commit()
R.id.settings ->
supportFragmentManager.beginTransaction()
.replace(R.id.layout, SettingsPage())
.commit()
}
}
}
}

How to retrieve sub-array of an array in json through api using volley in Android?

JSON api file:
{
"state": "Jammu and Kashmir",
"statecode": "JK",
"districtData": [
{
"district": "Anantnag",
"notes": "",
"active": 107,
"confirmed": 109,
"deceased": 1,
"recovered": 1,
"delta": {
"confirmed": 0,
"deceased": 0,
"recovered": 0
}
},
{
"district": "Budgam",
"notes": "",
"active": 18,
"confirmed": 30,
"deceased": 0,
"recovered": 12,
"delta": {
"confirmed": 4,
"deceased": 0,
"recovered": 0
}
}
]
}
Java Code:
StringRequest stringRequest = new StringRequest(Request.Method.GET,
"https://api.covid19india.org/v2/state_district_wise.json",
new Response.Listener<String>() {
#Override
public void onResponse(String response) {
try {
JSONObject jsonObject = new JSONObject(response);
JSONArray jsonArray = jsonObject.getJSONArray("districtData");
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject object = jsonArray.getJSONObject(i);
// Need to get data here !!!
}
progressDialog.cancel();
} catch (Exception e) {
}
}
}, new Response.ErrorListener() {
#Override
public void onErrorResponse(VolleyError error) {
}
});
RequestQueue requestQueue = Volley.newRequestQueue(this);
requestQueue.add(stringRequest);
Logcat (debug): Down below is the logcat which I am getting when trying to run my app.
2020-05-05 16:21:49.663 8813-8813/? I/owais.wabah202: Late-enabling -Xcheck:jni
2020-05-05 16:21:50.013 8813-8813/com.johnowais.wabah2020 I/Perf: Connecting to perf service.
2020-05-05 16:21:50.160 8813-8813/com.johnowais.wabah2020 W/owais.wabah202: Accessing hidden method Landroid/graphics/drawable/Drawable;->getOpticalInsets()Landroid/graphics/Insets; (light greylist, linking)
2020-05-05 16:21:50.160 8813-8813/com.johnowais.wabah2020 W/owais.wabah202: Accessing hidden field Landroid/graphics/Insets;->left:I (light greylist, linking)
2020-05-05 16:21:50.160 8813-8813/com.johnowais.wabah2020 W/owais.wabah202: Accessing hidden field Landroid/graphics/Insets;->right:I (light greylist, linking)
2020-05-05 16:21:50.160 8813-8813/com.johnowais.wabah2020 W/owais.wabah202: Accessing hidden field Landroid/graphics/Insets;->top:I (light greylist, linking)
2020-05-05 16:21:50.160 8813-8813/com.johnowais.wabah2020 W/owais.wabah202: Accessing hidden field Landroid/graphics/Insets;->bottom:I (light greylist, linking)
2020-05-05 16:21:50.235 8813-8813/com.johnowais.wabah2020 W/owais.wabah202: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection)
2020-05-05 16:21:50.239 8813-8813/com.johnowais.wabah2020 W/owais.wabah202: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection)
2020-05-05 16:21:50.289 8813-8813/com.johnowais.wabah2020 W/owais.wabah202: Accessing hidden method Landroid/widget/TextView;->getTextDirectionHeuristic()Landroid/text/TextDirectionHeuristic; (light greylist, linking)
2020-05-05 16:21:50.389 8813-8813/com.johnowais.wabah2020 D/OpenGLRenderer: Skia GL Pipeline
2020-05-05 16:21:50.495 8813-8856/com.johnowais.wabah2020 I/Adreno: QUALCOMM build : 2df12b3, I07da2d9908
Build Date : 10/04/18
OpenGL ES Shader Compiler Version: EV031.25.03.01
Local Branch :
Remote Branch :
Remote Branch :
Reconstruct Branch :
2020-05-05 16:21:50.495 8813-8856/com.johnowais.wabah2020 I/Adreno: Build Config : S L 6.0.7 AArch64
2020-05-05 16:21:50.495 8813-8856/com.johnowais.wabah2020 D/vndksupport: Loading /vendor/lib64/hw/gralloc.msm8953.so from current namespace instead of sphal namespace.
2020-05-05 16:21:50.502 8813-8856/com.johnowais.wabah2020 I/Adreno: PFP: 0x005ff087, ME: 0x005ff063
2020-05-05 16:21:50.509 8813-8856/com.johnowais.wabah2020 I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
2020-05-05 16:21:50.509 8813-8856/com.johnowais.wabah2020 I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
2020-05-05 16:21:50.511 8813-8856/com.johnowais.wabah2020 I/OpenGLRenderer: Initialized EGL, version 1.4
2020-05-05 16:21:50.511 8813-8856/com.johnowais.wabah2020 D/OpenGLRenderer: Swap behavior 2
2020-05-05 16:21:50.513 8813-8858/com.johnowais.wabah2020 D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2020-05-05 16:21:50.515 8813-8858/com.johnowais.wabah2020 I/DpmTcmClient: RegisterTcmMonitor from: com.android.okhttp.TcmIdleTimerMonitor
2020-05-05 16:21:50.565 8813-8856/com.johnowais.wabah2020 D/vndksupport: Loading /vendor/lib64/hw/android.hardware.graphics.mapper#2.0-impl.so from current namespace instead of sphal namespace.
2020-05-05 16:21:50.566 8813-8856/com.johnowais.wabah2020 D/vndksupport: Loading /vendor/lib64/hw/gralloc.msm8953.so from current namespace instead of sphal namespace.
I am not able to fetch data as it is not in proper format. I want to use where clause also which will give me data of each district of a state which I want.
API link: https://api.covid19india.org/v2/state_district_wise.json
STRUCTURE
JsonArrayRequest request = new JsonArrayRequest(Request.Method.GET, "https://api.covid19india.org/v2/state_district_wise.json",null,
new Response.Listener<JSONArray>() {
#Override
public void onResponse(JSONArray response) {
try {
for (int i = 0; i < response.length(); i++) {
JSONObject dataOBJ = response.getJSONObject(i);
JSONArray jsonChild = dataOBJ.getJSONArray("districtData");
for (int k = 0; k < jsonChild.length(); k++) {
JSONObject obj = jsonChild.getJSONObject(k);
int active = obj.getInt("active");
String district = obj.getString("district");
JSONObject child = obj.getJSONObject("delta");
int confirmed = child.getInt("confirmed");
}
}
} catch (Exception exp) {
}
}
}, new Response.ErrorListener() {
#Override
public void onErrorResponse(VolleyError error) {
}
});
RequestQueue requestQueue = Volley.newRequestQueue(this);
requestQueue.add(request);
Try this way
StringRequest stringRequest = new StringRequest(Request.Method.GET,
"https://api.covid19india.org/v2/state_district_wise.json",
new Response.Listener<String>() {
#Override
public void onResponse(String response) {
Log.d(TAG, "onResponse: "+response);
try {
JSONArray responseArray = new JSONArray(response);
for (int i = 0; i < responseArray.length(); i++) {
JSONObject stateObject = responseArray.getJSONObject(i);
JSONArray districtArray = stateObject.getJSONArray("districtData");
for(int j=0; j<districtArray.length(); j++){
JSONObject districtObject = districtArray.getJSONObject(j);
//do what you want to do with district object
Log.d(TAG, "onResponse: "+districtObject.toString());
}
}
}catch (JSONException e){
Log.d(TAG, "onResponse: "+e.getMessage());
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
#Override
public void onErrorResponse(VolleyError error) {
error.printStackTrace();
}
});
RequestQueue requestQueue = Volley.newRequestQueue(this);
requestQueue.add(stringRequest);

firebase database snapshot crashes when i add 2 datasnapshots to look after

i am using firebase database and wanted to match a value (the schoolcode) of the user being added to contacts with current users value ( schoolcode) and when i added the code user1.getSchoolCode it started crashing any ideas?
if i pass just a simple string like if (user.getSchoolcode().equals("001")) {
users.add(user);
} it works but user1.getSchoolCode dont work
RecyclerView recyclerView;
UserAdapter userAdapter;
List<User> users;
FirebaseUser firebaseUser;
DatabaseReference reference;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_contacts_parent);
recyclerView = findViewById(R.id.recycler_view);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
users = new ArrayList<>();
firebaseUser = FirebaseAuth.getInstance().getCurrentUser();
reference = FirebaseDatabase.getInstance().getReference("teacher");
readUsers();
}
private void readUsers() {
reference.addValueEventListener(new ValueEventListener() {
#Override
public void onDataChange(#NonNull DataSnapshot dataSnapshot) {
users.clear();
for (DataSnapshot snapshot : dataSnapshot.getChildren()) {
DataSnapshot snapshot1 = dataSnapshot.child(firebaseUser.getUid());
User user = snapshot.getValue(User.class);
User user1 = snapshot1.getValue(User.class);
assert user != null;
if (user.getSchoolcode().equals(user1.getSchoolcode())) {
users.add(user);
}
}
userAdapter= new UserAdapter(getApplicationContext(), users);
recyclerView.setAdapter(userAdapter);
}
#Override
public void onCancelled(#NonNull DatabaseError databaseError) {
}
});
}
}
thanks in advance
this is the logcat
2020-04-15 16:01:44.851 15021-15021/net.gobz.gobz D/AndroidRuntime: Shutting down VM
2020-04-15 16:01:44.852 15021-15021/net.gobz.gobz E/AndroidRuntime: FATAL EXCEPTION: main
Process: net.gobz.gobz, PID: 15021
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String net.gobz.gobz.Model.User.getSchoolcode()' on a null object reference
at net.gobz.gobz.parent.ContactsParentActivity$1.onDataChange(ContactsParentActivity.java:69)
at com.google.firebase.database.core.ValueEventRegistration.fireEvent(com.google.firebase:firebase-database##19.2.1:75)
at com.google.firebase.database.core.view.DataEvent.fire(com.google.firebase:firebase-database##19.2.1:63)
at com.google.firebase.database.core.view.EventRaiser$1.run(com.google.firebase:firebase-database##19.2.1:55)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7099)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
2020-04-15 16:01:44.864 15021-15021/net.gobz.gobz I/Process: Sending signal. PID: 15021 SIG: 9
i dont know if you need this too
2020-04-15 15:55:56.298 15021-15021/? E/Zygote: isWhitelistProcess - Process is Whitelisted
2020-04-15 15:55:56.298 15021-15021/? E/Zygote: accessInfo : 1
2020-04-15 15:55:56.304 15021-15021/? I/net.gobz.gobz: Late-enabling -Xcheck:jni
2020-04-15 15:55:56.336 15021-15021/? I/net.gobz.gobz: report jit thread pid = 15027
2020-04-15 15:55:56.966 15021-15021/net.gobz.gobz I/MultiDex: VM with version 2.1.0 has multidex support
2020-04-15 15:55:56.967 15021-15021/net.gobz.gobz I/MultiDex: Installing application
2020-04-15 15:55:56.967 15021-15021/net.gobz.gobz I/MultiDex: VM has multidex support, MultiDex support library is disabled.
2020-04-15 15:55:57.011 15021-15057/net.gobz.gobz W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
2020-04-15 15:55:57.029 15021-15021/net.gobz.gobz D/FirebaseAuth: Notifying id token listeners about user ( RvM1ycqh35Vxzi4M8NzHGaFERMp1 ).
2020-04-15 15:55:57.034 15021-15021/net.gobz.gobz I/FirebaseInitProvider: FirebaseApp initialization successful
2020-04-15 15:55:57.042 15021-15059/net.gobz.gobz W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
2020-04-15 15:55:57.051 15021-15059/net.gobz.gobz I/FirebaseAuth: [FirebaseAuth:] Preparing to create service connection to gms implementation
2020-04-15 15:55:57.114 15021-15021/net.gobz.gobz W/net.gobz.gobz: Accessing hidden method Landroid/graphics/drawable/Drawable;->getOpticalInsets()Landroid/graphics/Insets; (light greylist, linking)
2020-04-15 15:55:57.114 15021-15021/net.gobz.gobz W/net.gobz.gobz: Accessing hidden field Landroid/graphics/Insets;->left:I (light greylist, linking)
2020-04-15 15:55:57.114 15021-15021/net.gobz.gobz W/net.gobz.gobz: Accessing hidden field Landroid/graphics/Insets;->right:I (light greylist, linking)
2020-04-15 15:55:57.114 15021-15021/net.gobz.gobz W/net.gobz.gobz: Accessing hidden field Landroid/graphics/Insets;->top:I (light greylist, linking)
2020-04-15 15:55:57.114 15021-15021/net.gobz.gobz W/net.gobz.gobz: Accessing hidden field Landroid/graphics/Insets;->bottom:I (light greylist, linking)
2020-04-15 15:55:57.141 15021-15021/net.gobz.gobz W/Glide: Failed to find GeneratedAppGlideModule. You should include an annotationProcessor compile dependency on com.github.bumptech.glide:compiler in your application and a #GlideModule annotated AppGlideModule implementation or LibraryGlideModules will be silently ignored
2020-04-15 15:55:57.193 15021-15021/net.gobz.gobz I/DecorView: createDecorCaptionView >> DecorView#a917524[], isFloating: false, isApplication: true, hasWindowDecorCaption: false, hasWindowControllerCallback: true
2020-04-15 15:55:57.228 15021-15021/net.gobz.gobz W/net.gobz.gobz: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection)
2020-04-15 15:55:57.229 15021-15021/net.gobz.gobz W/net.gobz.gobz: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection)
2020-04-15 15:55:57.295 15021-15021/net.gobz.gobz W/net.gobz.gobz: Accessing hidden method Landroid/widget/TextView;->getTextDirectionHeuristic()Landroid/text/TextDirectionHeuristic; (light greylist, linking)
2020-04-15 15:55:57.339 15021-15021/net.gobz.gobz W/net.gobz.gobz: Accessing hidden field Landroid/view/View;->mAccessibilityDelegate:Landroid/view/View$AccessibilityDelegate; (light greylist, reflection)
2020-04-15 15:55:57.572 15021-15021/net.gobz.gobz D/OpenGLRenderer: Skia GL Pipeline
2020-04-15 15:55:57.578 15021-15021/net.gobz.gobz D/EmergencyMode: [EmergencyManager] android createPackageContext successful
2020-04-15 15:55:57.641 15021-15021/net.gobz.gobz D/InputTransport: Input channel constructed: fd=64
2020-04-15 15:55:57.642 15021-15021/net.gobz.gobz D/ViewRootImpl#98b94c[MainParentActivity]: setView = DecorView#a917524[MainParentActivity] TM=true MM=false
2020-04-15 15:55:57.670 15021-15066/net.gobz.gobz D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2020-04-15 15:55:57.676 15021-15066/net.gobz.gobz D/NetworkManagementSocketTagger: tagSocket(62) with statsTag=0xffffffff, statsUid=-1
2020-04-15 15:55:57.734 15021-15021/net.gobz.gobz D/ViewRootImpl#98b94c[MainParentActivity]: Relayout returned: old=[0,0][1080,2340] new=[0,0][1080,2340] result=0x7 surface={true 537833799680} changed=true
2020-04-15 15:55:57.751 15021-15065/net.gobz.gobz I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
2020-04-15 15:55:57.752 15021-15065/net.gobz.gobz I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
2020-04-15 15:55:57.752 15021-15065/net.gobz.gobz I/OpenGLRenderer: Initialized EGL, version 1.4
2020-04-15 15:55:57.752 15021-15065/net.gobz.gobz D/OpenGLRenderer: Swap behavior 2
2020-04-15 15:55:57.766 15021-15065/net.gobz.gobz D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
2020-04-15 15:55:57.766 15021-15065/net.gobz.gobz D/OpenGLRenderer: eglCreateWindowSurface = 0x7d3d346e00, 0x7d39648010
2020-04-15 15:55:57.832 15021-15021/net.gobz.gobz D/ViewRootImpl#98b94c[MainParentActivity]: Relayout returned: old=[0,0][1080,2340] new=[0,0][1080,2340] result=0x3 surface={true 537833799680} changed=false
2020-04-15 15:55:57.967 15021-15021/net.gobz.gobz D/ViewRootImpl#98b94c[MainParentActivity]: MSG_RESIZED: frame=[0,0][1080,2340] ci=[0,83][0,126] vi=[0,83][0,126] or=1
2020-04-15 15:55:57.968 15021-15021/net.gobz.gobz D/ViewRootImpl#98b94c[MainParentActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1
2020-04-15 15:55:57.968 15021-15021/net.gobz.gobz D/InputMethodManager: prepareNavigationBarInfo() DecorView#a917524[MainParentActivity]
2020-04-15 15:55:57.969 15021-15021/net.gobz.gobz D/InputMethodManager: getNavigationBarColor() -855310
2020-04-15 15:55:57.979 15021-15021/net.gobz.gobz D/InputMethodManager: prepareNavigationBarInfo() DecorView#a917524[MainParentActivity]
2020-04-15 15:55:57.979 15021-15021/net.gobz.gobz D/InputMethodManager: getNavigationBarColor() -855310
2020-04-15 15:55:57.979 15021-15021/net.gobz.gobz V/InputMethodManager: Starting input: tba=net.gobz.gobz ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
2020-04-15 15:55:57.979 15021-15021/net.gobz.gobz D/InputMethodManager: startInputInner - Id : 0
2020-04-15 15:55:57.979 15021-15021/net.gobz.gobz I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
2020-04-15 15:55:57.990 15021-15040/net.gobz.gobz D/InputTransport: Input channel constructed: fd=84
2020-04-15 15:55:57.990 15021-15021/net.gobz.gobz D/InputMethodManager: prepareNavigationBarInfo() DecorView#a917524[MainParentActivity]
2020-04-15 15:55:57.991 15021-15021/net.gobz.gobz D/InputMethodManager: getNavigationBarColor() -855310
2020-04-15 15:55:57.991 15021-15021/net.gobz.gobz V/InputMethodManager: Starting input: tba=net.gobz.gobz ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
2020-04-15 15:55:57.991 15021-15021/net.gobz.gobz D/InputMethodManager: startInputInner - Id : 0
2020-04-15 15:56:00.294 15021-15021/net.gobz.gobz W/ClassMapper: No setter/field for studentname found on class net.gobz.gobz.Model.User
2020-04-15 15:56:00.295 15021-15021/net.gobz.gobz W/ClassMapper: No setter/field for grade found on class net.gobz.gobz.Model.User
2020-04-15 15:56:00.295 15021-15021/net.gobz.gobz W/ClassMapper: No setter/field for section found on class net.gobz.gobz.Model.User
2020-04-15 15:56:00.296 15021-15021/net.gobz.gobz W/ClassMapper: No setter/field for status found on class net.gobz.gobz.Model.User
here is a screenshot of my database
i have one more problem now when i touch the contact and open the messaging activity it is crashing again
this is my messages activity
CircleImageView imageView;
FirebaseUser firebaseUser;
DatabaseReference reference;
Intent intent;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_message);
final Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle("");
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
finish();
}
});
imageView = findViewById(R.id.profile_image);
intent = getIntent();
String userid = intent.getStringExtra("userid");
firebaseUser = FirebaseAuth.getInstance().getCurrentUser();
reference = FirebaseDatabase.getInstance().getReference("parent").child(userid);
reference.addValueEventListener(new ValueEventListener() {
#Override
public void onDataChange(#NonNull DataSnapshot dataSnapshot) {
User user = dataSnapshot.getValue(User.class);
if (user.getImageURL().equals("default")) {
imageView.setImageResource(R.drawable.ic_user);
}else {
Glide.with(MessageActivity.this).load(user.getImageURL()).into(imageView);
}
}
#Override
public void onCancelled(#NonNull DatabaseError databaseError) {
}
});
}
}
and this is the intent i was calling for
holder.itemView.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Intent intent = new Intent(context, MessageActivity.class);
intent.putExtra("userid", user.getId());
context.startActivity(intent);
}
});
first get current user from Firebase
private void getCurrentUser(String userID) {
Log.("UserId==>",userID+"");//do check this value in teacher database
FirebaseDatabase.getInstance().getReference("parent").child(userID).addValueEventListener(new ValueEventListener() {
#Override
public void onDataChange(#NonNull DataSnapshot dataSnapshot) {
try{ if(dataSnapshot != null){ Log.e("UserVal==>", snapshot.getValue(JSONObject.class));
User user1 = snapshot.getValue(User.class);
readUsers(user1.getSchoolcode());}} catch (Exception e){e.printstacktrace(); Log.e("getusererror",e.getMessage());}
}
#Override
public void onCancelled(#NonNull DatabaseError databaseError) {
}
});
}
And update your readUsers method like this , you can also change parameter to pass User instead of schoolCode
private void readUsers(String schoolCode) {
reference.addValueEventListener(new ValueEventListener() {
#Override
public void onDataChange(#NonNull DataSnapshot dataSnapshot) {
try{ users.clear();
for (DataSnapshot snapshot : dataSnapshot.getChildren()) {
User user = snapshot.getValue(User.class);
assert user != null;
if (user.getSchoolcode().equals(schoolCode)) {
users.add(user);
}
}
userAdapter= new UserAdapter(getApplicationContext(), users);
recyclerView.setAdapter(userAdapter);} catch (Exception e){e.printstacktrace(); Log.e("readError",e.getMessage());}
}
#Override
public void onCancelled(#NonNull DatabaseError databaseError) {
}
});
}
first Call the getCurrentUser method
firebaseUser = FirebaseAuth.getInstance().getCurrentUser();
reference = FirebaseDatabase.getInstance().getReference("teacher");
getCurrentUser(firebaseUser.getUid());// readUsers()

Received an exception FAILED_PRECONDITION: The query requires an index [duplicate]

This question already has an answer here:
Firestore whereEqualTo, orderBy and limit(1) not working
(1 answer)
Closed 3 years ago.
I create the project in firebase using a cloud database and I want to compare empUID field which store in a document with current UID.
I created one query which gets the data when current UID and empUID is match but failed to get data.
Please guide is my Query right or am I need to changes in my code
MY Subcollection Path
Employer(root Collection)-->Job Post(Sub collection)-->Job Applicant
Details(sub collection of Job post)
Logcat
2020-02-10 10:38:36.239 29836-29895/com.example.part_time_job I/Adreno: Build Config : S P 6.0.7 AArch64
2020-02-10 10:38:36.231 29836-29836/com.example.part_time_job W/RenderThread: type=1400 audit(0.0:9359): avc: denied { search } for name="proc" dev="debugfs" ino=16085 scontext=u:r:untrusted_app:s0:c183,c257,c512,c768 tcontext=u:object_r:qti_debugfs:s0 tclass=dir permissive=0
2020-02-10 10:38:36.242 29836-29895/com.example.part_time_job I/Adreno: PFP: 0x016ee180, ME: 0x00000000
2020-02-10 10:38:36.231 29836-29836/com.example.part_time_job W/RenderThread: type=1400 audit(0.0:9360): avc: denied { search } for name="ctx" dev="debugfs" ino=16114 scontext=u:r:untrusted_app:s0:c183,c257,c512,c768 tcontext=u:object_r:qti_debugfs:s0 tclass=dir permissive=0
2020-02-10 10:38:36.245 29836-29895/com.example.part_time_job I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
2020-02-10 10:38:36.245 29836-29895/com.example.part_time_job I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
2020-02-10 10:38:36.245 29836-29895/com.example.part_time_job D/libEGL: eglInitialize: exit(res=1)
2020-02-10 10:38:36.245 29836-29895/com.example.part_time_job I/OpenGLRenderer: Initialized EGL, version 1.4
2020-02-10 10:38:36.246 29836-29895/com.example.part_time_job D/OpenGLRenderer: Swap behavior 2
2020-02-10 10:38:36.241 29836-29836/com.example.part_time_job W/RenderThread: type=1400 audit(0.0:9361): avc: denied { search } for name="ctx" dev="debugfs" ino=16114 scontext=u:r:untrusted_app:s0:c183,c257,c512,c768 tcontext=u:object_r:qti_debugfs:s0 tclass=dir permissive=0
2020-02-10 10:38:36.369 29836-29894/com.example.part_time_job W/e.part_time_jo: Accessing hidden method Ljava/security/spec/ECParameterSpec;->setCurveName(Ljava/lang/String;)V (light greylist, reflection)
2020-02-10 10:38:36.391 29836-29894/com.example.part_time_job W/e.part_time_jo: Accessing hidden method Ldalvik/system/BlockGuard;->getThreadPolicy()Ldalvik/system/BlockGuard$Policy; (light greylist, linking)
2020-02-10 10:38:36.391 29836-29894/com.example.part_time_job W/e.part_time_jo: Accessing hidden method Ldalvik/system/BlockGuard$Policy;->onNetwork()V (light greylist, linking)
2020-02-10 10:38:37.656 29836-29836/com.example.part_time_job E/RecyclerView: No adapter attached; skipping layout
2020-02-10 10:38:38.262 29836-29836/com.example.part_time_job E/Register4: Received an exception FAILED_PRECONDITION: The query requires an index. You can create it here: https://console.firebase.google.com/v1/r/project/part-time-job-74d92/firestore/indexes?create_composite=Cmxwcm9qZWN0cy9wYXJ0LXRpbWUtam9iLTc0ZDkyL2RhdGFiYXNlcy8oZGVmYXVsdCkvY29sbGVjdGlvbkdyb3Vwcy9Kb2IgQXBwbGljYW50IERldGFpbHMvaW5kZXhlcy9DSUNBZ09qWGg0RUsQAhoKCgZlbXBVSUQQARoKCgZ1c2VySWQQARoMCghfX25hbWVfXxAB
2020-02-10 10:38:38.263 29836-29877/com.example.part_time_job W/Firestore: (21.3.1) [Firestore]: Listen for Query(target=Query( collectionGroup=Job Applicant Details where userId == uOQXpA8WSgWb5DeDqXxLsdEz0G22 and empUID == null order by __name__);limitType=LIMIT_TO_FIRST) failed: Status{code=FAILED_PRECONDITION, description=The query requires an index. You can create it here: https://console.firebase.google.com/v1/r/project/part-time-job-74d92/firestore/indexes?create_composite=Cmxwcm9qZWN0cy9wYXJ0LXRpbWUtam9iLTc0ZDkyL2RhdGFiYXNlcy8oZGVmYXVsdCkvY29sbGVjdGlvbkdyb3Vwcy9Kb2IgQXBwbGljYW50IERldGFpbHMvaW5kZXhlcy9DSUNBZ09qWGg0RUsQAhoKCgZlbXBVSUQQARoKCgZ1c2VySWQQARoMCghfX25hbWVfXxAB, cause=null}
2020-02-10 10:38:41.232 29836-29870/com.example.part_time_job V/FA: Inactivity, disconnecting from the service
My Java Code
package com.example.part_time_job;
import android.location.Address;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.firestore.CollectionReference;
import com.google.firebase.firestore.DocumentSnapshot;
import com.google.firebase.firestore.FirebaseFirestore;
import com.google.firebase.firestore.QueryDocumentSnapshot;
import com.google.firebase.firestore.QuerySnapshot;
import java.util.ArrayList;
import java.util.List;
import model.FInalApplyNotification;
import model.Jobpost;
import ui.JournalRecyclerAdapterNotificationEmp;
import util.JournalApi;
/**
* A simple {#link Fragment} subclass.
*/
public class HistoryFragment extends Fragment {
private static final String TAG = "Register4";
private FirebaseUser user;
private FirebaseAuth firebaseAuth;
private FirebaseAuth.AuthStateListener authStateListener;
private FirebaseFirestore db = FirebaseFirestore.getInstance();
private List<FInalApplyNotification> journalList;
private String empid;
private String title;
private String currentUserId;
private RecyclerView recyclerViewnotifyemp;
private JournalRecyclerAdapterNotificationEmp journalRecyclerAdapterNotificationEmp;
private CollectionReference collectionReference=db.collection("Employer");
private TextView no_listnotifyemp;
public HistoryFragment() {
// Required empty public constructor
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view=inflater.inflate(R.layout.fragment_history, container, false);
firebaseAuth= FirebaseAuth.getInstance();
user =firebaseAuth.getCurrentUser();
no_listnotifyemp= view.findViewById(R.id.no_listnotifyemp);
journalList=new ArrayList<>();
recyclerViewnotifyemp=view.findViewById(R.id.recyclerViewnotifyemp);
recyclerViewnotifyemp.setHasFixedSize(true);
recyclerViewnotifyemp.setLayoutManager(new LinearLayoutManager(getActivity()));
currentUserId=JournalApi.getInstance().getUserId();
return view;
}
#Override
public void onStart() {
super.onStart();
if (journalList!=null){
journalList.clear();
}
FInalApplyNotification fInalApplyNotification=new FInalApplyNotification();
fInalApplyNotification.setTitle(title);
fInalApplyNotification.setUserId(currentUserId);
db.collectionGroup("Job Applicant Details").whereEqualTo("userId",currentUserId).whereEqualTo("empUID",fInalApplyNotification.getEmpUID())
.get()
.addOnSuccessListener(new OnSuccessListener<QuerySnapshot>() {
#Override
public void onSuccess(QuerySnapshot queryDocumentSnapshots) {
if (!queryDocumentSnapshots.isEmpty()) {
for (QueryDocumentSnapshot journals : queryDocumentSnapshots) {
FInalApplyNotification fInalApplyNotification = journals.toObject(FInalApplyNotification.class);
journalList.add(fInalApplyNotification);
}
journalRecyclerAdapterNotificationEmp = new JournalRecyclerAdapterNotificationEmp(getActivity(), journalList);
recyclerViewnotifyemp.setAdapter(journalRecyclerAdapterNotificationEmp);
journalRecyclerAdapterNotificationEmp.notifyDataSetChanged();
} else {
no_listnotifyemp.setVisibility(View.VISIBLE);
}
}
})
.addOnFailureListener(new OnFailureListener() {
#Override
public void onFailure(#NonNull Exception e) {
Log.e(TAG, "Received an exception " + e.getMessage() );
}
});
}
}
My Query
db.collectionGroup("Job Applicant Details").whereEqualTo("userId",currentUserId).whereEqualTo("empUID",fInalApplyNotification.getEmpUID())
Firebase firestore have mainly 2 types of queries
Simple queries
Compound queries
Simple queries have only where condition, so they don't need database indexes, like
FirebaseFirestore.getInstance().collection("cities")
.whereEqualTo("capital", true)
.get()
.addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
#Override
public void onComplete(#NonNull Task<QuerySnapshot> task) {
if (task.isSuccessful()) {
for (QueryDocumentSnapshot document : task.getResult()) {
Log.d(TAG, document.getId() + " => " + document.getData());
}
} else {
Log.d(TAG, "Error getting documents: ", task.getException());
}
}
});
Your query is compound query which has multiple Where queries chained together which needs composite index, you can either create composite index in firebase console or create composite index using error message, creating index using error message is easier one, which is printed in your log message, as it handles the fields and sorting order and directly creates index for you
As the exception states, you must create an index for the query you are performing.
FAILED_PRECONDITION: The query requires an index. You can create it here: {some link}
The link provided by the exception, when entered into a browser will load the Firebase Console with all the details you need to create the index needed for the query. So you just need to visit the link and follow the instructions.

Android Azure Active Directory Authentication Library (ADAL) - ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy#

I am fairly new to android/java. I am trying to incorporate the example code for ADAL into my app, but when I call mAuthContext.aquireToken(), login prompt does not appear and I see errors in logcat about no activity for token. Is my activity getting destroyed for some reason?
I've searched but I'm not finding others that have this same kind of problem. I have a feeling I modified some code that is causing this and I cannot find what it is. I have tried different ways of referencing the activity in the first param of mAuthContext.acquireToken() but I don't think that is the problem. Any help is MUCH appreciated!
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setLogo(R.drawable.kclogo);
getSupportActionBar().setDisplayUseLogoEnabled(true);
scanButton = (Button) findViewById(R.id.scanButton);
signOutButton = (Button) findViewById(R.id.signoutButton);
signOutButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
onSignOutClicked();
}
});
scanButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
onScanClicked();
}
});
mAuthContext = new AuthenticationContext(getApplicationContext(), AUTHORITY, false);
/* Instantiate handler which can invoke interactive sign-in to get the Resource
* sIntSignInInvoked ensures interactive sign-in is invoked one at a time */
mAcquireTokenHandler = new Handler(Looper.getMainLooper()) {
#Override
public void handleMessage(Message msg) {
if (sIntSignInInvoked.compareAndSet(false, true)) {
try {
if (msg.what == MSG_INTERACTIVE_SIGN_IN_PROMPT_AUTO) {
Log.i(TAG, "$$$ Launching - MSG_INTERACTIVE_SIGN_IN_PROMPT_AUTO");
mAuthContext.acquireToken(getActivity(), RESOURCE_ID, CLIENT_ID, REDIRECT_URI, PromptBehavior.Auto, getAuthInteractiveCallback());
} else if (msg.what == MSG_INTERACTIVE_SIGN_IN_PROMPT_ALWAYS) {
mAuthContext.acquireToken(getActivity(), RESOURCE_ID, CLIENT_ID, REDIRECT_URI, PromptBehavior.Always, getAuthInteractiveCallback());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
};
/* ADAL Logging callback setup */
Logger.getInstance().setExternalLogger(new Logger.ILogger() {
#Override
public void Log(String tag, String message, String additionalMessage, Logger.LogLevel level, ADALError errorCode) {
// You can filter the logs depending on level or errorcode.
Log.d(TAG, message + " " + additionalMessage);
}
});
/*Attempt an acquireTokenSilent call to see if we're signed in*/
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
String userId = preferences.getString(USER_ID, "");
if(!TextUtils.isEmpty(userId)) {
Log.d(TAG,"Silent");
mAuthContext.acquireTokenSilentAsync(RESOURCE_ID, CLIENT_ID, userId, getAuthSilentCallback());
}
}
private void onScanClicked() {
mAcquireTokenHandler.sendEmptyMessage(MSG_INTERACTIVE_SIGN_IN_PROMPT_AUTO);
}
LOGCAT:
2018-12-19 14:07:06.702 15061-15061/com.solvednetworks.cptool I/MainActivity: $$$ Launching - MSG_INTERACTIVE_SIGN_IN_PROMPT_AUTO
2018-12-19 14:07:06.716 15061-15061/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:06-56b96149-f5c0-41d6-8195-baac64ea35a9-Sending async task from thread:15061 ver:1.14.1 null
2018-12-19 14:07:06.724 15061-15097/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:06-56b96149-f5c0-41d6-8195-baac64ea35a9-Running task in thread:15097 ver:1.14.1 null
2018-12-19 14:07:06.731 15061-15097/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:06-56b96149-f5c0-41d6-8195-baac64ea35a9-Broker auth is turned off or no valid broker is available on the device, cannot switch to broker. ver:1.14.1 null
2018-12-19 14:07:06.736 15061-15097/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:06-56b96149-f5c0-41d6-8195-baac64ea35a9-Try to acquire token silently, return valid AT or use RT in the cache. ver:1.14.1 null
2018-12-19 14:07:06.742 15061-15097/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:06-56b96149-f5c0-41d6-8195-baac64ea35a9-Try to silently get token from local cache. ver:1.14.1 null
2018-12-19 14:07:06.759 15061-15097/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:06-56b96149-f5c0-41d6-8195-baac64ea35a9-No access token exists. ver:1.14.1 null
2018-12-19 14:07:06.764 15061-15097/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:06-56b96149-f5c0-41d6-8195-baac64ea35a9-No valid access token exists, try with refresh token. ver:1.14.1 null
2018-12-19 14:07:06.785 15061-15097/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:06-56b96149-f5c0-41d6-8195-baac64ea35a9-Regular token cache entry does not exist, try with MRRT. ver:1.14.1 null
2018-12-19 14:07:06.800 15061-15097/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:06-56b96149-f5c0-41d6-8195-baac64ea35a9-MRRT token does not exist, try with FRT ver:1.14.1 null
2018-12-19 14:07:06.807 15061-15097/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:06-56b96149-f5c0-41d6-8195-baac64ea35a9-FRT cache item does not exist, fall back to try MRRT. ver:1.14.1 null
2018-12-19 14:07:06.811 15061-15097/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:06-56b96149-f5c0-41d6-8195-baac64ea35a9-Send request to use MRRT for new AT. ver:1.14.1 null
2018-12-19 14:07:06.816 15061-15097/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:06-56b96149-f5c0-41d6-8195-baac64ea35a9-MRRT does not exist, cannot proceed with MRRT for new AT. ver:1.14.1 null
2018-12-19 14:07:06.822 15061-15097/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:06-56b96149-f5c0-41d6-8195-baac64ea35a9-Broker auth is turned off or no valid broker is available on the device, cannot switch to broker. ver:1.14.1 null
2018-12-19 14:07:06.830 15061-15097/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:06-56b96149-f5c0-41d6-8195-baac64ea35a9-Put waiting request. requestId:93475433 CorrelationId: 56b96149-f5c0-41d6-8195-baac64ea35a9 ver:1.14.1 null
2018-12-19 14:07:06.837 15061-15097/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:06-56b96149-f5c0-41d6-8195-baac64ea35a9-Broker auth is turned off or no valid broker is available on the device, cannot switch to broker. ver:1.14.1 null
2018-12-19 14:07:06.843 15061-15097/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:06-56b96149-f5c0-41d6-8195-baac64ea35a9-Starting Authentication Activity for embedded flow. ver:1.14.1 null
2018-12-19 14:07:06.880 1918-2527/system_process I/ActivityManager: START u0 {cmp=com.solvednetworks.cptool/com.microsoft.aad.adal.AuthenticationActivity (has extras)} from uid 10092
2018-12-19 14:07:06.893 15061-15086/com.solvednetworks.cptool V/FA: Recording user engagement, ms: 1194
2018-12-19 14:07:06.901 15061-15061/com.solvednetworks.cptool W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy#ff0f877
2018-12-19 14:07:06.913 15061-15086/com.solvednetworks.cptool V/FA: Activity paused, time: 49751619
2018-12-19 14:07:06.926 15061-15061/com.solvednetworks.cptool V/FA: onActivityCreated
2018-12-19 14:07:06.939 15061-15086/com.solvednetworks.cptool D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=1194, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=2466986703034345432}]
2018-12-19 14:07:07.049 2743-15104/com.google.android.gms V/FA-SVC: Event recorded: Event{appId='com.solvednetworks.cptool', name='user_engagement(_e)', params=Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=1194, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=2466986703034345432}]}
2018-12-19 14:07:07.055 15061-15061/com.solvednetworks.cptool I/WebViewFactory: Loading com.android.chrome version 66.0.3359.158 (code 336015817)
2018-12-19 14:07:07.061 15061-15061/com.solvednetworks.cptool I/networks.cptoo: The ClassLoaderContext is a special shared library.
2018-12-19 14:07:07.100 15061-15061/com.solvednetworks.cptool I/cr_LibraryLoader: Time to load native libraries: 5 ms (timestamps 1821-1826)
2018-12-19 14:07:07.151 15061-15061/com.solvednetworks.cptool I/chromium: [INFO:library_loader_hooks.cc(36)] Chromium logging enabled: level = 0, default verbosity = 0
2018-12-19 14:07:07.152 15061-15061/com.solvednetworks.cptool I/cr_LibraryLoader: Expected native library version number "66.0.3359.158", actual native library version number "66.0.3359.158"
2018-12-19 14:07:07.187 15061-15110/com.solvednetworks.cptool W/cr_ChildProcLH: Create a new ChildConnectionAllocator with package name = com.android.chrome, sandboxed = true
2018-12-19 14:07:07.222 15061-15061/com.solvednetworks.cptool I/cr_BrowserStartup: Initializing chromium process, singleProcess=false
2018-12-19 14:07:07.224 1918-1946/system_process I/ActivityManager: Start proc 15112:com.android.chrome:sandboxed_process0/u0i12 for webview_service com.solvednetworks.cptool/org.chromium.content.app.SandboxedProcessService0
2018-12-19 14:07:07.225 15061-15061/com.solvednetworks.cptool I/cr_base: Android Locale: en_US requires .pak files: [en-GB.pak, en-US.pak]
2018-12-19 14:07:07.337 15061-15141/com.solvednetworks.cptool E/chromium: [ERROR:devtools_http_handler.cc(292)] Cannot start http server for devtools. Stop devtools.
2018-12-19 14:07:07.427 15061-15061/com.solvednetworks.cptool W/networks.cptoo: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker;->(Landroid/content/Context;I)V (light greylist, reflection)
2018-12-19 14:07:07.427 15061-15061/com.solvednetworks.cptool W/networks.cptoo: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker;->logEvent(Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;)V (light greylist, reflection)
2018-12-19 14:07:07.427 15061-15061/com.solvednetworks.cptool W/networks.cptoo: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionStarted(I)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)
2018-12-19 14:07:07.428 15061-15061/com.solvednetworks.cptool W/networks.cptoo: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionModified(II)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)
2018-12-19 14:07:07.428 15061-15061/com.solvednetworks.cptool W/networks.cptoo: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionModified(IILandroid/view/textclassifier/TextClassification;)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)
2018-12-19 14:07:07.428 15061-15061/com.solvednetworks.cptool W/networks.cptoo: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionModified(IILandroid/view/textclassifier/TextSelection;)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)
2018-12-19 14:07:07.428 15061-15061/com.solvednetworks.cptool W/networks.cptoo: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionAction(III)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)
2018-12-19 14:07:07.428 15061-15061/com.solvednetworks.cptool W/networks.cptoo: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionAction(IIILandroid/view/textclassifier/TextClassification;)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)
2018-12-19 14:07:07.458 15061-15061/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:07-56b96149-f5c0-41d6-8195-baac64ea35a9-AuthenticationActivity was created. ver:1.14.1 null
2018-12-19 14:07:07.515 15061-15061/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:07-56b96149-f5c0-41d6-8195-baac64ea35a9-Init broadcastReceiver with request. RequestId:93475433 ver:1.14.1 null
2018-12-19 14:07:07.524 15061-15061/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:07-56b96149-f5c0-41d6-8195-baac64ea35a9- ver:1.14.1 null
2018-12-19 14:07:07.530 15061-15061/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:07-56b96149-f5c0-41d6-8195-baac64ea35a9-Non-broker request for package com.solvednetworks.cptool ver:1.14.1 null
2018-12-19 14:07:07.536 15061-15061/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:07-56b96149-f5c0-41d6-8195-baac64ea35a9-Device info:9 GoogleAndroid SDK built for x86 ver:1.14.1 null
2018-12-19 14:07:07.561 15061-15061/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:07-56b96149-f5c0-41d6-8195-baac64ea35a9-Correlation id for request sent is:56b96149-f5c0-41d6-8195-baac64ea35a9 ver:1.14.1 null
2018-12-19 14:07:07.618 15061-15086/com.solvednetworks.cptool D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=MainActivity, firebase_previous_id(_pi)=2466986703034345432, firebase_screen_class(_sc)=AuthenticationActivity, firebase_screen_id(_si)=2466986703034345433}]
2018-12-19 14:07:07.732 2743-15104/com.google.android.gms V/FA-SVC: Event recorded: Event{appId='com.solvednetworks.cptool', name='screen_view(_vs)', params=Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=MainActivity, firebase_previous_id(_pi)=2466986703034345432, firebase_screen_class(_sc)=AuthenticationActivity, firebase_screen_id(_si)=2466986703034345433}]}
2018-12-19 14:07:07.732 15061-15086/com.solvednetworks.cptool V/FA: Activity resumed, time: 49752310
2018-12-19 14:07:07.851 15061-15061/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:07-56b96149-f5c0-41d6-8195-baac64ea35a9-Launching webview for acquiring auth code. ver:1.14.1 null
2018-12-19 14:07:07.873 15061-15131/com.solvednetworks.cptool W/cr_media: Requires BLUETOOTH permission
2018-12-19 14:07:07.885 15061-15098/com.solvednetworks.cptool D/EGL_emulation: eglMakeCurrent: 0xd2bcfa40: ver 3 0 (tinfo 0xd25ec380)
2018-12-19 14:07:07.929 15061-15150/com.solvednetworks.cptool D/EGL_emulation: eglCreateContext: 0xc92a7860: maj 3 min 0 rcv 3
2018-12-19 14:07:07.929 15061-15150/com.solvednetworks.cptool D/EGL_emulation: eglMakeCurrent: 0xc92a7860: ver 3 0 (tinfo 0xc7d922e0)
2018-12-19 14:07:07.936 1918-1954/system_process I/ActivityManager: Displayed com.solvednetworks.cptool/com.microsoft.aad.adal.AuthenticationActivity: +1s23ms
2018-12-19 14:07:08.062 15061-15150/com.solvednetworks.cptool W/VideoCapabilities: Unrecognized profile 4 for video/hevc
2018-12-19 14:07:08.119 15061-15061/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:08-56b96149-f5c0-41d6-8195-baac64ea35a9-Webview starts loading. ver:1.14.1 null
2018-12-19 14:07:08.130 15061-15150/com.solvednetworks.cptool I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
2018-12-19 14:07:08.133 15061-15061/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:08-56b96149-f5c0-41d6-8195-baac64ea35a9-DisplaySpinner:true showing:false ver:1.14.1 null
2018-12-19 14:07:08.170 15061-15150/com.solvednetworks.cptool W/cr_MediaCodecUtil: HW encoder for video/avc is not available on this device.
2018-12-19 14:07:08.185 15061-15150/com.solvednetworks.cptool D/EGL_emulation: eglCreateContext: 0xeccc3160: maj 3 min 0 rcv 3
2018-12-19 14:07:08.185 15061-15150/com.solvednetworks.cptool D/EGL_emulation: eglMakeCurrent: 0xeccc3160: ver 3 0 (tinfo 0xc7d922e0)
2018-12-19 14:07:08.504 1754-1754/? D/SurfaceFlinger: duplicate layer name: changing com.solvednetworks.cptool/com.microsoft.aad.adal.AuthenticationActivity to com.solvednetworks.cptool/com.microsoft.aad.adal.AuthenticationActivity#1
2018-12-19 14:07:08.597 15061-15098/com.solvednetworks.cptool D/EGL_emulation: eglMakeCurrent: 0xd2bcfa40: ver 3 0 (tinfo 0xd25ec380)
2018-12-19 14:07:08.728 15061-15061/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:08-56b96149-f5c0-41d6-8195-baac64ea35a9-Navigation is detected ver:1.14.1 null
2018-12-19 14:07:08.737 15061-15061/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:08-56b96149-f5c0-41d6-8195-baac64ea35a9-Navigation starts with the redirect uri. ver:1.14.1 null
2018-12-19 14:07:08.752 15061-15061/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:08-56b96149-f5c0-41d6-8195-baac64ea35a9-It is not a broker request ver:1.14.1 null
2018-12-19 14:07:08.759 15061-15061/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:08-56b96149-f5c0-41d6-8195-baac64ea35a9-Return To Caller:2003 ver:1.14.1 null
2018-12-19 14:07:08.767 15061-15061/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:08-56b96149-f5c0-41d6-8195-baac64ea35a9-DisplaySpinner:false showing:true ver:1.14.1 null
2018-12-19 14:07:08.781 15061-15098/com.solvednetworks.cptool D/EGL_emulation: eglMakeCurrent: 0xd2bcfa40: ver 3 0 (tinfo 0xd25ec380)
2018-12-19 14:07:08.792 1754-1754/? D/SurfaceFlinger: duplicate layer name: changing Surface(name=cf5a7cb com.solvednetworks.cptool/com.microsoft.aad.adal.AuthenticationActivity)/#0x60bde66 - animation-leash to Surface(name=cf5a7cb com.solvednetworks.cptool/com.microsoft.aad.adal.AuthenticationActivity)/#0x60bde66 - animation-leash#1
2018-12-19 14:07:08.802 15061-15061/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:08-56b96149-f5c0-41d6-8195-baac64ea35a9-Set request id related to response. REQUEST_ID for caller returned to:93475433 ver:1.14.1 null
2018-12-19 14:07:08.830 15061-15061/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:08-56b96149-f5c0-41d6-8195-baac64ea35a9-AuthenticationActivity onPause unregister receiver ver:1.14.1 null
2018-12-19 14:07:08.833 15061-15086/com.solvednetworks.cptool V/FA: Recording user engagement, ms: 1250
2018-12-19 14:07:08.835 15061-15061/com.solvednetworks.cptool D/MainActivity: 2018-12-19 21:07:08-56b96149-f5c0-41d6-8195-baac64ea35a9-Spinner at onPause will dismiss ver:1.14.1 null
2018-12-19 14:07:08.844 15061-15086/com.solvednetworks.cptool V/FA: Activity paused, time: 49753559
2018-12-19 14:07:08.875 15061-15086/com.solvednetworks.cptool D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=1250, firebase_screen_class(_sc)=AuthenticationActivity, firebase_screen_id(_si)=2466986703034345433}]
2018-12-19 14:07:08.974 15061-15061/com.solvednetworks.cptool W/networks.cptoo: Attempt to remove non-JNI local reference, dumping thread
2018-12-19 14:07:08.987 1754-1940/? W/SurfaceFlinger: Attempting to set client state on removed layer: com.solvednetworks.cptool/com.microsoft.aad.adal.AuthenticationActivity#1
2018-12-19 14:07:08.987 1754-1940/? W/SurfaceFlinger: Attempting to destroy on removed layer: com.solvednetworks.cptool/com.microsoft.aad.adal.AuthenticationActivity#1
2018-12-19 14:07:08.987 2743-15104/com.google.android.gms V/FA-SVC: Event recorded: Event{appId='com.solvednetworks.cptool', name='user_engagement(_e)', params=Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=1250, firebase_screen_class(_sc)=AuthenticationActivity, firebase_screen_id(_si)=2466986703034345433}]}
2018-12-19 14:07:08.989 15061-15098/com.solvednetworks.cptool D/EGL_emulation: eglMakeCurrent: 0xd2bcfa40: ver 3 0 (tinfo 0xd25ec380)
2018-12-19 14:07:09.032 15061-15086/com.solvednetworks.cptool D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=AuthenticationActivity, firebase_previous_id(_pi)=2466986703034345433, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=2466986703034345432}]
2018-12-19 14:07:09.123 15061-15086/com.solvednetworks.cptool V/FA: Activity resumed, time: 49753582
2018-12-19 14:07:09.128 2743-15104/com.google.android.gms V/FA-SVC: Event recorded: Event{appId='com.solvednetworks.cptool', name='screen_view(_vs)', params=Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=AuthenticationActivity, firebase_previous_id(_pi)=2466986703034345433, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=2466986703034345432}]}
2018-12-19 14:07:09.150 15061-15098/com.solvednetworks.cptool D/EGL_emulation: eglMakeCurrent: 0xd2bcfa40: ver 3 0 (tinfo 0xd25ec380)
2018-12-19 14:07:14.126 15061-15086/com.solvednetworks.cptool V/FA: Inactivity, disconnecting from the service

Categories

Resources