0

I am working on a project from last 1 month. One day I wrote the code and closed the android studio. After that when I opened it some code was automatically changed and doesn't maked any sense. Like before, a java code of my activity was looking like this- enter image description here

but now it is looking like this- enter image description here

enter image description here

Why did this happened. I was working on this project from very long but many of my hard work is ruined. The code automatically changed to something like null null null... as in the screen shot. this only happened to some of my java activity's. Please if anyone know why this happened and how to fix it please tell me.

Arnav
  • 439
  • 2
  • 4
  • 11
  • Please have a look at [TOUR], [ASK], how to write a [MCVE] and https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-errors-when-asking-a-question – fantaghirocco Nov 24 '21 at 13:23
  • please clear what you are trying to say? – Arnav Nov 24 '21 at 13:29
  • yep. It was just a example. I have written in the question that some files code is changed. BTW please tell me the cause of error if you know – Arnav Nov 24 '21 at 13:32
  • Thankyou! It worked. But why did this happened? – Arnav Nov 25 '21 at 03:32
  • _"But why did this happened?"_ Well, it's a bug in Android Studio. There's a ticket about it: [https://issuetracker.google.com/issues/119638289](https://issuetracker.google.com/issues/119638289) If you have any useful information about how it happened you can add a comment there. I guess it's difficult for the Android Studio developers to reproduce. – Markus Kauppinen Nov 25 '21 at 13:19

1 Answers1

1

check in local history, you will be able to get the recent changes there.

adding steps-

  1. right click on file in which you are facing issue.

  2. click on "local history", it will give option to show history.

attaching screenshot for better understanding.

M.K
  • 11
  • 4
  • 1
    Add steps that the user has to do in order to see recent changes, imagine that the user has no idea of how to do it. – allexiusw Nov 24 '21 at 14:34
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 24 '21 at 14:34