title: Fragment recreated after activity killed on low memory
body: <p>I have an <code>Activity</code> with a <code>ViewPager</code> inside. When activity created a <code>asyncTask</code> is executed and when task is finished a <code>Fragment</code> is created using the result data.(Important note: without this data <code>Fragment</code> create view will crash because its explictly needs that data)</p>
  
  <p>Now after <code>Fragment</code> is created i go back to home screen, open another app and so on and create a low memory situation. My <code>Activity</code> is killed because of the low memory.</p>
  
  <p>Now i open task manager and click my app again.</p>
  
  <p>Android tries to bring everything back on the screen. Since all the <code>Activity</code> is killed data is also lost but it still tries to recreate the fragment although there is no data and my app crashes.</p>
  
  <p>What can I do?... I have two solution (well at least theoritical solutions)</p>
  
  <ol>
  <li><p>prevent activity restart on resume (how can i do that????)</p></li>
  <li><p>prevent fragment create view to use data unless it exists</p></li>
  </ol>
  
  <p>Well i did implement the second solution. So app doesnt crash in the beginning because "no data exist" is handeld. BUT i realised that ViewPager also disconnected from the fragments because well activity was killed. So i can not reach the fragment back from the activity.</p>