Realm-java: Cannot pass parameters to super(); in a class's constructor that extends RealmBaseAdapter

Created on 18 Jun 2016  路  3Comments  路  Source: realm/realm-java

I have a problem that I cannot pass the parameters "context, realmResults, automaticUpdate" to super(); in a class's constructor that extends RealmBaseAdapter. See my code and the screenshot to be clear for you.

Code Sample

package com.twitter.i_droidi.notah;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import io.realm.RealmBaseAdapter;
import io.realm.RealmObject;
import io.realm.RealmResults;

public class RealmModelAdapter <T extends RealmObject> extends RealmBaseAdapter<T> {

    public RealmModelAdapter(Context context, RealmResults<T> realmResults, boolean automaticUpdate)
    {
        super(context, realmResults, automaticUpdate);
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        return null;
    }
}

Screenshot

http://i.imgur.com/W7roGlg.png

Version of Realm and tooling

Realm version(s): 1.0.1

Android Studio version: 2.1.2

T-Help

Most helpful comment

Exactly.

Your signature is this

super(context, realmResults, automaticUpdate);

While that signature is this

public RealmBaseAdapter(@NonNull Context context, @Nullable OrderedRealmCollection<T> data) {

It has changed since 0.90.0 if I know right.

All 3 comments

I am pretty sure there is no such constructor for the Realm Android Adapter's latest version which works in conjunction with Realm 1.0.0 and above.

Exactly.

Your signature is this

super(context, realmResults, automaticUpdate);

While that signature is this

public RealmBaseAdapter(@NonNull Context context, @Nullable OrderedRealmCollection<T> data) {

It has changed since 0.90.0 if I know right.

Was this page helpful?
0 / 5 - 0 ratings