Layout files messed up after adding recycler view Unable to eddit and code is gone replaced with java












0















I implemented a recycler view into my app. I decided to make a change to the layout files and when I did all of them except for a few recently created ones looked this.



RecyclerView.Adapter {



public List<BlogPost> blog_list;

public BlogRecyclerAdapter(List<BlogPost> blog_list) {

this.blog_list = blog_list;

}

@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {

View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.blog_list_item, parent, false);
return new ViewHolder(view);
}


@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {

String desc_data = blog_list.get(position).getDesc();
holder.setDescText(desc_data);

}

@Override
public int getItemCount() {
return blog_list.size();
}

public class ViewHolder extends RecyclerView.ViewHolder {

private View mView;

private TextView descView;
private ImageView blogImageView;
private StorageReference mImageStorage;
private DatabaseReference mUserDatabase;

public ViewHolder(View itemView) {
super(itemView);
mView = itemView;

}

public void setDescText(String descText) {

descView = mView.findViewById(R.id.blog_desc);
descView.setText(descText);

}

public void setBlogImage(String downloadUri) {

blogImageView = mView.findViewById(R.id.Post_image_view);

StorageReference filepath = mImageStorage.child("profile_images").child(curren


here are a few examples of the other XML files https://snag.gy/hbXBcZ.jpg https://snag.gy/TmXFzQ.jpg I am very confused on what has caused this and i am at a loss on what to try










share|improve this question























  • Restore the old files within your IDE or your version control system.

    – Thorbjørn Ravn Andersen
    Jan 2 at 2:10


















0















I implemented a recycler view into my app. I decided to make a change to the layout files and when I did all of them except for a few recently created ones looked this.



RecyclerView.Adapter {



public List<BlogPost> blog_list;

public BlogRecyclerAdapter(List<BlogPost> blog_list) {

this.blog_list = blog_list;

}

@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {

View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.blog_list_item, parent, false);
return new ViewHolder(view);
}


@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {

String desc_data = blog_list.get(position).getDesc();
holder.setDescText(desc_data);

}

@Override
public int getItemCount() {
return blog_list.size();
}

public class ViewHolder extends RecyclerView.ViewHolder {

private View mView;

private TextView descView;
private ImageView blogImageView;
private StorageReference mImageStorage;
private DatabaseReference mUserDatabase;

public ViewHolder(View itemView) {
super(itemView);
mView = itemView;

}

public void setDescText(String descText) {

descView = mView.findViewById(R.id.blog_desc);
descView.setText(descText);

}

public void setBlogImage(String downloadUri) {

blogImageView = mView.findViewById(R.id.Post_image_view);

StorageReference filepath = mImageStorage.child("profile_images").child(curren


here are a few examples of the other XML files https://snag.gy/hbXBcZ.jpg https://snag.gy/TmXFzQ.jpg I am very confused on what has caused this and i am at a loss on what to try










share|improve this question























  • Restore the old files within your IDE or your version control system.

    – Thorbjørn Ravn Andersen
    Jan 2 at 2:10
















0












0








0








I implemented a recycler view into my app. I decided to make a change to the layout files and when I did all of them except for a few recently created ones looked this.



RecyclerView.Adapter {



public List<BlogPost> blog_list;

public BlogRecyclerAdapter(List<BlogPost> blog_list) {

this.blog_list = blog_list;

}

@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {

View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.blog_list_item, parent, false);
return new ViewHolder(view);
}


@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {

String desc_data = blog_list.get(position).getDesc();
holder.setDescText(desc_data);

}

@Override
public int getItemCount() {
return blog_list.size();
}

public class ViewHolder extends RecyclerView.ViewHolder {

private View mView;

private TextView descView;
private ImageView blogImageView;
private StorageReference mImageStorage;
private DatabaseReference mUserDatabase;

public ViewHolder(View itemView) {
super(itemView);
mView = itemView;

}

public void setDescText(String descText) {

descView = mView.findViewById(R.id.blog_desc);
descView.setText(descText);

}

public void setBlogImage(String downloadUri) {

blogImageView = mView.findViewById(R.id.Post_image_view);

StorageReference filepath = mImageStorage.child("profile_images").child(curren


here are a few examples of the other XML files https://snag.gy/hbXBcZ.jpg https://snag.gy/TmXFzQ.jpg I am very confused on what has caused this and i am at a loss on what to try










share|improve this question














I implemented a recycler view into my app. I decided to make a change to the layout files and when I did all of them except for a few recently created ones looked this.



RecyclerView.Adapter {



public List<BlogPost> blog_list;

public BlogRecyclerAdapter(List<BlogPost> blog_list) {

this.blog_list = blog_list;

}

@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {

View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.blog_list_item, parent, false);
return new ViewHolder(view);
}


@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {

String desc_data = blog_list.get(position).getDesc();
holder.setDescText(desc_data);

}

@Override
public int getItemCount() {
return blog_list.size();
}

public class ViewHolder extends RecyclerView.ViewHolder {

private View mView;

private TextView descView;
private ImageView blogImageView;
private StorageReference mImageStorage;
private DatabaseReference mUserDatabase;

public ViewHolder(View itemView) {
super(itemView);
mView = itemView;

}

public void setDescText(String descText) {

descView = mView.findViewById(R.id.blog_desc);
descView.setText(descText);

}

public void setBlogImage(String downloadUri) {

blogImageView = mView.findViewById(R.id.Post_image_view);

StorageReference filepath = mImageStorage.child("profile_images").child(curren


here are a few examples of the other XML files https://snag.gy/hbXBcZ.jpg https://snag.gy/TmXFzQ.jpg I am very confused on what has caused this and i am at a loss on what to try







java android xml






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 2 at 0:01







user9495575




















  • Restore the old files within your IDE or your version control system.

    – Thorbjørn Ravn Andersen
    Jan 2 at 2:10





















  • Restore the old files within your IDE or your version control system.

    – Thorbjørn Ravn Andersen
    Jan 2 at 2:10



















Restore the old files within your IDE or your version control system.

– Thorbjørn Ravn Andersen
Jan 2 at 2:10







Restore the old files within your IDE or your version control system.

– Thorbjørn Ravn Andersen
Jan 2 at 2:10














0






active

oldest

votes











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%2f53999893%2flayout-files-messed-up-after-adding-recycler-view-unable-to-eddit-and-code-is-go%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown
























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















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%2f53999893%2flayout-files-messed-up-after-adding-recycler-view-unable-to-eddit-and-code-is-go%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

MongoDB - Not Authorized To Execute Command

Npm cannot find a required file even through it is in the searched directory

in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith