FirebaseRecyclerAdapter Adapter using android studio can not convert String to Object












-1















when i use FirebaseRecyclerAdapter class gives me this error:
Can't convert object of type java.lang.String to type com.photoblog.kyrillos.blog.Model.Users after I add this two lines of code it crashes
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(linearLayoutManager);



my Code is



import android.content.Context; 
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.firebase.ui.database.FirebaseRecyclerAdapter;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.photoblog.kyrillos.blog.Model.Users;
import com.photoblog.kyrillos.blog.R;

import de.hdodenhof.circleimageview.CircleImageView;

public class HomeActivity extends AppCompatActivity {

private Toolbar homeToolbar;
private FirebaseAuth mAuth;

private DatabaseReference mDatabase;
private RecyclerView recyclerView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
mAuth = FirebaseAuth.getInstance();
mDatabase = FirebaseDatabase.getInstance().getReference().child("Users").child(mAuth.getCurrentUser().getUid());
homeToolbar = findViewById(R.id.homeToolbar);
setSupportActionBar(homeToolbar);
getSupportActionBar().setTitle("Home");

recyclerView = findViewById(R.id.recyclerView);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
}


@Override
protected void onStart() {
super.onStart();
FirebaseRecyclerAdapter<Users,BlogViewHolder > adapter =
new FirebaseRecyclerAdapter<Users, BlogViewHolder >(
Users.class,
R.layout.blog_row,
BlogViewHolder .class,
mDatabase){
@Override
protected void populateViewHolder(BlogViewHolder viewHolder, Users model, int position) {
viewHolder.setUserImage(HomeActivity.this,model.getImage());
viewHolder.setUserName(model.getName());
viewHolder.setPostImage(HomeActivity.this,model.getPostImage());
viewHolder.setPostDescription(model.getPostDescription());
}
};
recyclerView.setAdapter(adapter);
}

public static class BlogViewHolder extends RecyclerView.ViewHolder{
View mView;
public BlogViewHolder (@NonNull View itemView) {
super(itemView);
mView = itemView;
}
public void setUserImage(Context context,String url){
CircleImageView imageView = mView.findViewById(R.id.postUserImageView);
Glide.with(context)
.load(url)
.into(imageView);
}
public void setUserName(String userName){
TextView view = mView.findViewById(R.id.postUserNameView);
view.setText(userName);
}

public void setPostImage(Context context,String postImage){
ImageView postImageView = mView.findViewById(R.id.postImageView);
Glide.with(context)
.load(postImage)
.into(postImageView);
}

public void setPostDescription(String postDescription){
TextView postTextView = mView.findViewById(R.id.postTextView);
postTextView.setText(postDescription);
}

}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main_menu,menu);
return super.onCreateOptionsMenu(menu);
}


@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.action_add){
startActivity(new Intent(HomeActivity.this,PostActivity.class));
} else if (item.getItemId() == R.id.action_settings) {
startActivity(new Intent(HomeActivity.this,SettingsActivity.class));
} else if (item.getItemId() == R.id.action_logOut) {
mAuth.signOut();
startActivity(new Intent(HomeActivity.this,LoginActivity.class));
finish();
}
return super.onOptionsItemSelected(item);
}
}


and User Model :



public class Users {
private String Email,Image, Name;
private String Password ,Phone, postImage, postDescription;

public Users() {
}

public Users(String email, String image, String name, String password, String phone, String postImage, String postDescription) {
Email = email;
Image = image;
Name = name;
Password = password;
Phone = phone;
this.postImage = postImage;
this.postDescription = postDescription;
}


public String getEmail() {
return Email;
}

public void setEmail(String email) {
Email = email;
}

public String getImage() {
return Image;
}

public void setImage(String image) {
Image = image;
}

public String getName() {
return Name;
}

public void setName(String name) {
Name = name;
}

public String getPassword() {
return Password;
}

public void setPassword(String password) {
Password = password;
}

public String getPhone() {
return Phone;
}

public void setPhone(String phone) {
Phone = phone;
}

public String getPostImage() {
return postImage;
}

public void setPostImage(String postImage) {
this.postImage = postImage;
}

public String getPostDescription() {
return postDescription;
}

public void setPostDescription(String postDescription) {
this.postDescription = postDescription;
}
}









share|improve this question

























  • on which line you're getting this error?

    – Tejas Pandya
    Jan 1 at 8:52











  • It doesn't give me line only this Can't convert object of type java.lang.String to type com.photoblog.kyrillos.blog.Model.Users

    – Kyrillos
    Jan 1 at 10:21
















-1















when i use FirebaseRecyclerAdapter class gives me this error:
Can't convert object of type java.lang.String to type com.photoblog.kyrillos.blog.Model.Users after I add this two lines of code it crashes
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(linearLayoutManager);



my Code is



import android.content.Context; 
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.firebase.ui.database.FirebaseRecyclerAdapter;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.photoblog.kyrillos.blog.Model.Users;
import com.photoblog.kyrillos.blog.R;

import de.hdodenhof.circleimageview.CircleImageView;

public class HomeActivity extends AppCompatActivity {

private Toolbar homeToolbar;
private FirebaseAuth mAuth;

private DatabaseReference mDatabase;
private RecyclerView recyclerView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
mAuth = FirebaseAuth.getInstance();
mDatabase = FirebaseDatabase.getInstance().getReference().child("Users").child(mAuth.getCurrentUser().getUid());
homeToolbar = findViewById(R.id.homeToolbar);
setSupportActionBar(homeToolbar);
getSupportActionBar().setTitle("Home");

recyclerView = findViewById(R.id.recyclerView);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
}


@Override
protected void onStart() {
super.onStart();
FirebaseRecyclerAdapter<Users,BlogViewHolder > adapter =
new FirebaseRecyclerAdapter<Users, BlogViewHolder >(
Users.class,
R.layout.blog_row,
BlogViewHolder .class,
mDatabase){
@Override
protected void populateViewHolder(BlogViewHolder viewHolder, Users model, int position) {
viewHolder.setUserImage(HomeActivity.this,model.getImage());
viewHolder.setUserName(model.getName());
viewHolder.setPostImage(HomeActivity.this,model.getPostImage());
viewHolder.setPostDescription(model.getPostDescription());
}
};
recyclerView.setAdapter(adapter);
}

public static class BlogViewHolder extends RecyclerView.ViewHolder{
View mView;
public BlogViewHolder (@NonNull View itemView) {
super(itemView);
mView = itemView;
}
public void setUserImage(Context context,String url){
CircleImageView imageView = mView.findViewById(R.id.postUserImageView);
Glide.with(context)
.load(url)
.into(imageView);
}
public void setUserName(String userName){
TextView view = mView.findViewById(R.id.postUserNameView);
view.setText(userName);
}

public void setPostImage(Context context,String postImage){
ImageView postImageView = mView.findViewById(R.id.postImageView);
Glide.with(context)
.load(postImage)
.into(postImageView);
}

public void setPostDescription(String postDescription){
TextView postTextView = mView.findViewById(R.id.postTextView);
postTextView.setText(postDescription);
}

}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main_menu,menu);
return super.onCreateOptionsMenu(menu);
}


@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.action_add){
startActivity(new Intent(HomeActivity.this,PostActivity.class));
} else if (item.getItemId() == R.id.action_settings) {
startActivity(new Intent(HomeActivity.this,SettingsActivity.class));
} else if (item.getItemId() == R.id.action_logOut) {
mAuth.signOut();
startActivity(new Intent(HomeActivity.this,LoginActivity.class));
finish();
}
return super.onOptionsItemSelected(item);
}
}


and User Model :



public class Users {
private String Email,Image, Name;
private String Password ,Phone, postImage, postDescription;

public Users() {
}

public Users(String email, String image, String name, String password, String phone, String postImage, String postDescription) {
Email = email;
Image = image;
Name = name;
Password = password;
Phone = phone;
this.postImage = postImage;
this.postDescription = postDescription;
}


public String getEmail() {
return Email;
}

public void setEmail(String email) {
Email = email;
}

public String getImage() {
return Image;
}

public void setImage(String image) {
Image = image;
}

public String getName() {
return Name;
}

public void setName(String name) {
Name = name;
}

public String getPassword() {
return Password;
}

public void setPassword(String password) {
Password = password;
}

public String getPhone() {
return Phone;
}

public void setPhone(String phone) {
Phone = phone;
}

public String getPostImage() {
return postImage;
}

public void setPostImage(String postImage) {
this.postImage = postImage;
}

public String getPostDescription() {
return postDescription;
}

public void setPostDescription(String postDescription) {
this.postDescription = postDescription;
}
}









share|improve this question

























  • on which line you're getting this error?

    – Tejas Pandya
    Jan 1 at 8:52











  • It doesn't give me line only this Can't convert object of type java.lang.String to type com.photoblog.kyrillos.blog.Model.Users

    – Kyrillos
    Jan 1 at 10:21














-1












-1








-1


0






when i use FirebaseRecyclerAdapter class gives me this error:
Can't convert object of type java.lang.String to type com.photoblog.kyrillos.blog.Model.Users after I add this two lines of code it crashes
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(linearLayoutManager);



my Code is



import android.content.Context; 
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.firebase.ui.database.FirebaseRecyclerAdapter;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.photoblog.kyrillos.blog.Model.Users;
import com.photoblog.kyrillos.blog.R;

import de.hdodenhof.circleimageview.CircleImageView;

public class HomeActivity extends AppCompatActivity {

private Toolbar homeToolbar;
private FirebaseAuth mAuth;

private DatabaseReference mDatabase;
private RecyclerView recyclerView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
mAuth = FirebaseAuth.getInstance();
mDatabase = FirebaseDatabase.getInstance().getReference().child("Users").child(mAuth.getCurrentUser().getUid());
homeToolbar = findViewById(R.id.homeToolbar);
setSupportActionBar(homeToolbar);
getSupportActionBar().setTitle("Home");

recyclerView = findViewById(R.id.recyclerView);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
}


@Override
protected void onStart() {
super.onStart();
FirebaseRecyclerAdapter<Users,BlogViewHolder > adapter =
new FirebaseRecyclerAdapter<Users, BlogViewHolder >(
Users.class,
R.layout.blog_row,
BlogViewHolder .class,
mDatabase){
@Override
protected void populateViewHolder(BlogViewHolder viewHolder, Users model, int position) {
viewHolder.setUserImage(HomeActivity.this,model.getImage());
viewHolder.setUserName(model.getName());
viewHolder.setPostImage(HomeActivity.this,model.getPostImage());
viewHolder.setPostDescription(model.getPostDescription());
}
};
recyclerView.setAdapter(adapter);
}

public static class BlogViewHolder extends RecyclerView.ViewHolder{
View mView;
public BlogViewHolder (@NonNull View itemView) {
super(itemView);
mView = itemView;
}
public void setUserImage(Context context,String url){
CircleImageView imageView = mView.findViewById(R.id.postUserImageView);
Glide.with(context)
.load(url)
.into(imageView);
}
public void setUserName(String userName){
TextView view = mView.findViewById(R.id.postUserNameView);
view.setText(userName);
}

public void setPostImage(Context context,String postImage){
ImageView postImageView = mView.findViewById(R.id.postImageView);
Glide.with(context)
.load(postImage)
.into(postImageView);
}

public void setPostDescription(String postDescription){
TextView postTextView = mView.findViewById(R.id.postTextView);
postTextView.setText(postDescription);
}

}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main_menu,menu);
return super.onCreateOptionsMenu(menu);
}


@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.action_add){
startActivity(new Intent(HomeActivity.this,PostActivity.class));
} else if (item.getItemId() == R.id.action_settings) {
startActivity(new Intent(HomeActivity.this,SettingsActivity.class));
} else if (item.getItemId() == R.id.action_logOut) {
mAuth.signOut();
startActivity(new Intent(HomeActivity.this,LoginActivity.class));
finish();
}
return super.onOptionsItemSelected(item);
}
}


and User Model :



public class Users {
private String Email,Image, Name;
private String Password ,Phone, postImage, postDescription;

public Users() {
}

public Users(String email, String image, String name, String password, String phone, String postImage, String postDescription) {
Email = email;
Image = image;
Name = name;
Password = password;
Phone = phone;
this.postImage = postImage;
this.postDescription = postDescription;
}


public String getEmail() {
return Email;
}

public void setEmail(String email) {
Email = email;
}

public String getImage() {
return Image;
}

public void setImage(String image) {
Image = image;
}

public String getName() {
return Name;
}

public void setName(String name) {
Name = name;
}

public String getPassword() {
return Password;
}

public void setPassword(String password) {
Password = password;
}

public String getPhone() {
return Phone;
}

public void setPhone(String phone) {
Phone = phone;
}

public String getPostImage() {
return postImage;
}

public void setPostImage(String postImage) {
this.postImage = postImage;
}

public String getPostDescription() {
return postDescription;
}

public void setPostDescription(String postDescription) {
this.postDescription = postDescription;
}
}









share|improve this question
















when i use FirebaseRecyclerAdapter class gives me this error:
Can't convert object of type java.lang.String to type com.photoblog.kyrillos.blog.Model.Users after I add this two lines of code it crashes
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(linearLayoutManager);



my Code is



import android.content.Context; 
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.firebase.ui.database.FirebaseRecyclerAdapter;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.photoblog.kyrillos.blog.Model.Users;
import com.photoblog.kyrillos.blog.R;

import de.hdodenhof.circleimageview.CircleImageView;

public class HomeActivity extends AppCompatActivity {

private Toolbar homeToolbar;
private FirebaseAuth mAuth;

private DatabaseReference mDatabase;
private RecyclerView recyclerView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
mAuth = FirebaseAuth.getInstance();
mDatabase = FirebaseDatabase.getInstance().getReference().child("Users").child(mAuth.getCurrentUser().getUid());
homeToolbar = findViewById(R.id.homeToolbar);
setSupportActionBar(homeToolbar);
getSupportActionBar().setTitle("Home");

recyclerView = findViewById(R.id.recyclerView);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
}


@Override
protected void onStart() {
super.onStart();
FirebaseRecyclerAdapter<Users,BlogViewHolder > adapter =
new FirebaseRecyclerAdapter<Users, BlogViewHolder >(
Users.class,
R.layout.blog_row,
BlogViewHolder .class,
mDatabase){
@Override
protected void populateViewHolder(BlogViewHolder viewHolder, Users model, int position) {
viewHolder.setUserImage(HomeActivity.this,model.getImage());
viewHolder.setUserName(model.getName());
viewHolder.setPostImage(HomeActivity.this,model.getPostImage());
viewHolder.setPostDescription(model.getPostDescription());
}
};
recyclerView.setAdapter(adapter);
}

public static class BlogViewHolder extends RecyclerView.ViewHolder{
View mView;
public BlogViewHolder (@NonNull View itemView) {
super(itemView);
mView = itemView;
}
public void setUserImage(Context context,String url){
CircleImageView imageView = mView.findViewById(R.id.postUserImageView);
Glide.with(context)
.load(url)
.into(imageView);
}
public void setUserName(String userName){
TextView view = mView.findViewById(R.id.postUserNameView);
view.setText(userName);
}

public void setPostImage(Context context,String postImage){
ImageView postImageView = mView.findViewById(R.id.postImageView);
Glide.with(context)
.load(postImage)
.into(postImageView);
}

public void setPostDescription(String postDescription){
TextView postTextView = mView.findViewById(R.id.postTextView);
postTextView.setText(postDescription);
}

}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main_menu,menu);
return super.onCreateOptionsMenu(menu);
}


@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.action_add){
startActivity(new Intent(HomeActivity.this,PostActivity.class));
} else if (item.getItemId() == R.id.action_settings) {
startActivity(new Intent(HomeActivity.this,SettingsActivity.class));
} else if (item.getItemId() == R.id.action_logOut) {
mAuth.signOut();
startActivity(new Intent(HomeActivity.this,LoginActivity.class));
finish();
}
return super.onOptionsItemSelected(item);
}
}


and User Model :



public class Users {
private String Email,Image, Name;
private String Password ,Phone, postImage, postDescription;

public Users() {
}

public Users(String email, String image, String name, String password, String phone, String postImage, String postDescription) {
Email = email;
Image = image;
Name = name;
Password = password;
Phone = phone;
this.postImage = postImage;
this.postDescription = postDescription;
}


public String getEmail() {
return Email;
}

public void setEmail(String email) {
Email = email;
}

public String getImage() {
return Image;
}

public void setImage(String image) {
Image = image;
}

public String getName() {
return Name;
}

public void setName(String name) {
Name = name;
}

public String getPassword() {
return Password;
}

public void setPassword(String password) {
Password = password;
}

public String getPhone() {
return Phone;
}

public void setPhone(String phone) {
Phone = phone;
}

public String getPostImage() {
return postImage;
}

public void setPostImage(String postImage) {
this.postImage = postImage;
}

public String getPostDescription() {
return postDescription;
}

public void setPostDescription(String postDescription) {
this.postDescription = postDescription;
}
}






android firebase-realtime-database






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 1 at 16:33







Kyrillos

















asked Jan 1 at 4:52









KyrillosKyrillos

16




16













  • on which line you're getting this error?

    – Tejas Pandya
    Jan 1 at 8:52











  • It doesn't give me line only this Can't convert object of type java.lang.String to type com.photoblog.kyrillos.blog.Model.Users

    – Kyrillos
    Jan 1 at 10:21



















  • on which line you're getting this error?

    – Tejas Pandya
    Jan 1 at 8:52











  • It doesn't give me line only this Can't convert object of type java.lang.String to type com.photoblog.kyrillos.blog.Model.Users

    – Kyrillos
    Jan 1 at 10:21

















on which line you're getting this error?

– Tejas Pandya
Jan 1 at 8:52





on which line you're getting this error?

– Tejas Pandya
Jan 1 at 8:52













It doesn't give me line only this Can't convert object of type java.lang.String to type com.photoblog.kyrillos.blog.Model.Users

– Kyrillos
Jan 1 at 10:21





It doesn't give me line only this Can't convert object of type java.lang.String to type com.photoblog.kyrillos.blog.Model.Users

– Kyrillos
Jan 1 at 10:21












1 Answer
1






active

oldest

votes


















0














Sorry guys I found where's the error exactly.
instead this line



mDatabase = FirebaseDatabase.getInstance().getReference().child("Users").child(mAuth.getCurrentUser().getUid());


i should write this one



mDatabase = FirebaseDatabase.getInstance().getReference().child("Users");


thanks anyway for nothing .






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53993076%2ffirebaserecycleradapter-adapter-using-android-studio-can-not-convert-string-to-o%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Sorry guys I found where's the error exactly.
    instead this line



    mDatabase = FirebaseDatabase.getInstance().getReference().child("Users").child(mAuth.getCurrentUser().getUid());


    i should write this one



    mDatabase = FirebaseDatabase.getInstance().getReference().child("Users");


    thanks anyway for nothing .






    share|improve this answer




























      0














      Sorry guys I found where's the error exactly.
      instead this line



      mDatabase = FirebaseDatabase.getInstance().getReference().child("Users").child(mAuth.getCurrentUser().getUid());


      i should write this one



      mDatabase = FirebaseDatabase.getInstance().getReference().child("Users");


      thanks anyway for nothing .






      share|improve this answer


























        0












        0








        0







        Sorry guys I found where's the error exactly.
        instead this line



        mDatabase = FirebaseDatabase.getInstance().getReference().child("Users").child(mAuth.getCurrentUser().getUid());


        i should write this one



        mDatabase = FirebaseDatabase.getInstance().getReference().child("Users");


        thanks anyway for nothing .






        share|improve this answer













        Sorry guys I found where's the error exactly.
        instead this line



        mDatabase = FirebaseDatabase.getInstance().getReference().child("Users").child(mAuth.getCurrentUser().getUid());


        i should write this one



        mDatabase = FirebaseDatabase.getInstance().getReference().child("Users");


        thanks anyway for nothing .







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 3 at 8:30









        KyrillosKyrillos

        16




        16
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53993076%2ffirebaserecycleradapter-adapter-using-android-studio-can-not-convert-string-to-o%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

            SQL update select statement

            'app-layout' is not a known element: how to share Component with different Modules