Here is my code and I cannot figure out what is causing it to throw a cannot resolve constructor error. Any help would be greatly appreciated.
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ListView;
import android.widget.TextView;
import com.firebase.ui.FirebaseListAdapter;
import com.google.firebase.database.FirebaseDatabase;
public class Home extends AppCompatActivity {
private FirebaseDatabase mFirebaseRef;
FirebaseListAdapter<ChatMessage> mListAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
final ListView listView = (ListView) this.findViewById(android.R.id.list);
my error starts here under (this,
mListAdapter = new FirebaseListAdapter<ChatMessage>(this, ChatMessage.class,
android.R.layout.two_line_list_item, mFirebaseRef) {
@Override
protected void populateView(View v, ChatMessage model, int position) {
((TextView)v.findViewById(android.R.id.text1)).setText(model.getName());
((TextView)v.findViewById(android.R.id.text2)).setText(model.getText());
}
};
listView.setAdapter(mListAdapter);
};
}
Dependencies:
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support.constraint:constraint-layout:1.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-core:10.2.0'
compile 'com.google.firebase:firebase-auth:10.2.0'
compile 'com.google.firebase:firebase-database:10.2.0'
compile 'com.google.firebase:firebase-messaging:10.2.0'
compile 'com.google.firebase:firebase-crash:10.2.0'
compile 'com.android.support:recyclerview-v7:25.3.0'
compile 'com.firebaseui:firebase-ui:0.3.1'
You should be importing:
com.firebase.ui.database.FirebaseListAdapter
instead of:
com.firebase.ui.FirebaseListAdapter
Also make these changes to your build.gradle dependencies:
compile 'com.google.firebase:firebase-auth:10.2.0'
compile 'com.firebaseui:firebase-ui:1.2.0'
The table of Firebase UI compatible versions is in the documentation.