javaide icon indicating copy to clipboard operation
javaide copied to clipboard

Deleted open files' contents!

Open SofeemLi opened this issue 7 years ago • 5 comments
trafficstars

Greetings,

I was busy trying to test some code and I went out of the app to check the weather, and went I went back to the app all the contents of my open files were blank! I closed the files without saving and reopened but they were overwritten! This really would suck big time if it was a project with tons of code, luckily it was something I had just created.

SofeemLi avatar Jun 19 '18 18:06 SofeemLi

This might be related to a problem I'm having. Twice I was working on code and I turned, moving my phone sideways suddenly, and my code files went blank and nothing I tried restored the text.

ianMe2 avatar Jul 01 '18 23:07 ianMe2

It's rare but happened to me 2 times

This project are no longer maintained, =(

Any debug information would be useful for anyone willing to patch this bug

oong819 avatar Apr 29 '24 06:04 oong819

这是来自maxpixel的自动回复尊敬的用户,你好,请不要回复这个邮箱。如果您回复了这个邮箱,将不会得到任何有关您邮箱内容的答复,请见谅。如果对我们感兴趣请访问:maxpixel.top

masgithubs avatar Apr 29 '24 06:04 masgithubs

this code should be used to fix this issue or something like it

   
   private static final String KEY_YOUR_VALUE = "yourValue";
   private int yourValue;

   @Override
   protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.activity_main);
       
       if (savedInstanceState != null) {
           yourValue = savedInstanceState.getInt(KEY_YOUR_VALUE);
           // Restore your activity state here
       } else {
           // Initialize your activity for the first time
       }
   }

   @Override
   protected void onSaveInstanceState(Bundle outState) {
       outState.putInt(KEY_YOUR_VALUE, yourValue);
       super.onSaveInstanceState(outState);
   }

   @Override
   protected void onRestoreInstanceState(Bundle savedInstanceState) {
       super.onRestoreInstanceState(savedInstanceState);
       yourValue = savedInstanceState.getInt(KEY_YOUR_VALUE);
       // Restore your activity state here
   }
}

develperbayman avatar May 07 '24 10:05 develperbayman

Thanks a lot!

oong819 avatar May 10 '24 10:05 oong819