Note that there are some explanatory texts on larger screens.

plurals
  1. POSwitching between activities without reloading fragment and rss feeds
    text
    copied!<p>I have a homescreen containing mapfragment and rss feeds, which loads on startup. I have another few activities that contains magfragments just bigger.</p> <p>My problem is that when i move between activities they restart, i want them to remain loaded up for when i go back to that activity. To save the user from downloading data all over again.</p> <p>Any feedback appreciated</p> <p>Thank you</p> <p>This is what i have been using;</p> <pre><code>back.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View arg0) { Intent MapActivity = new Intent(getApplicationContext(),HomeActivity.class); startActivity(MapActivity); } }); protected void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.main); getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.window_title); new MyTask().execute(); map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap(); map.moveCamera(CameraUpdateFactory.newLatLngZoom(-, 15000)); map.animateCamera(CameraUpdateFactory.zoomTo(7), 2000, null); map.setMyLocationEnabled(true); map.setMapType(GoogleMap.MAP_TYPE_NORMAL); map.getUiSettings().setZoomControlsEnabled(true); map.getUiSettings().setMyLocationButtonEnabled(true); map.setTrafficEnabled(true); LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE); Location lastLocation = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER); // Get the location manager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); Criteria criteria = new Criteria(); provider = locationManager.getBestProvider(criteria, false); Location location = locationManager.getLastKnownLocation(provider); } </code></pre> <p>I dont use OnResume, is that my problem??</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload