'LifecycleOwner abc is attempting to register while current state is RESUMED. LifecycleOwners must call register before they are STARTED
I tried finding a solution to this issue but only found Kotlin solutions, so I figured I might ask here. My current setup is this (in MainActivity.java):
onCreate() {
// blabla
list1 = (ListView) findViewById(R.id.serverbrowser);
list1.setOnItemClickListener(
new AdapterView.OnItemClickListener()
{
@Override
public void onItemClick(AdapterView<?> arg0, View view,
int position, long id) {
connVPN(position);
}
}
);
}
void connVPN(int position){
// Do some server connection stuff
}
My exact issue is this:
java.lang.IllegalStateException: LifecycleOwner com.dev.app.MainActivity@6afc93f is attempting to register while current state is RESUMED. LifecycleOwners must call register before they are STARTED.
So, what should I do? I tried putting the code into a different class to no avail, also tried putting just the handling code inside another class to select it in the activity.xml file (which would be my favourite way of doing this), but that didn't work either.
Thanks!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
