Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inifite loop #13

Closed
mpopolin opened this issue Jan 2, 2018 · 12 comments
Closed

Inifite loop #13

mpopolin opened this issue Jan 2, 2018 · 12 comments

Comments

@mpopolin
Copy link

mpopolin commented Jan 2, 2018

Every second and later time I try to open the activity containing the CrispFragment, there is an infinite loop - the first load works perfectly, showing all messages and so on.
Tried with the example and the problem occurred as well.

@baptistejamin
Copy link
Member

baptistejamin commented Jan 2, 2018 via email

@mpopolin
Copy link
Author

mpopolin commented Jan 2, 2018

Using
compile 'im.crisp:crisp-sdk:0.1.0'

@baptistejamin
Copy link
Member

Do you have any output in your logs?

@mpopolin
Copy link
Author

mpopolin commented Jan 3, 2018

Not really. Do you have some tag to filter the logs?
Filtering by crisp there is the following log for the first time only - nothing appears after the first:

01-03 08:51:24.318 18024 18024 I art : at android.view.View im.crisp.sdk.ui.CrispFragment.onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle) (SourceFile:59)
01-03 08:51:24.318 18024 18024 I art : at android.view.View im.crisp.sdk.ui.CrispFragment.onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle) (SourceFile:59)

@baptistejamin
Copy link
Member

baptistejamin commented Jan 3, 2018 via email

@mpopolin
Copy link
Author

mpopolin commented Jan 3, 2018

Yes, I think I did (the very first time I open the activity, everything works fine, the chat is loaded and so on - the problem just happens in the second and so on attempt).

public class BaseApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        Crisp.initialize(this);
        Crisp.getInstance().setWebsiteId(BuildConfig.CRISP_KEY);
    }

And the Activity .xml layout:

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:app="http://schemas.android.com/apk/res-auto"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:layout_behavior="@string/appbar_scrolling_view_behavior">

    <fragment
        android:name="im.crisp.sdk.ui.CrispFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="0dp"
        android:tag="crisp_fragment"/>
</RelativeLayout>

@baptistejamin
Copy link
Member

baptistejamin commented Jan 3, 2018 via email

@mpopolin
Copy link
Author

mpopolin commented Jan 3, 2018

Android 7.1.1

@mpopolin
Copy link
Author

mpopolin commented Jan 4, 2018

@mywaystar not sure why yet (maybe flushing the queue wrongly for the second time?), but removing the static modifier from the isLoaded (and related methods) on CrispFragment solved the problem.

@baptistejamin
Copy link
Member

Could you chat with us on crisp.chat , I have very specific questions

@mpopolin
Copy link
Author

mpopolin commented Jan 4, 2018

Hi, started the chat but no responses.

@baptistejamin
Copy link
Member

It has been fixed. Thank you for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants