I created an app that connects to facebook and also downloads some pictures from a server and the profile picture from facebook.
Then I created an exit Button in my app that exits from the account that the user has been logged in with. The app then returns to the login page.
However, when I connect to facebook again after having logged out from the previous account, it shows me an OutOfMemory exception.
Then I increased the VM Heap size from 32 MB to 48MB and it still shows me an OutOfMemory exception.
How can I clear all of the downloaded data till now when the user logs into and then exits from his account in order to avoid from the OutOfMemory exception?
This is my ExitActivity:
public class ExitActivity extends Activity{
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.freinds_listview);
Session session = Session.getActiveSession();
if (!session.isClosed()) {
session.closeAndClearTokenInformation();
}
Intent i = new Intent(getApplicationContext(), MainActivity.class);
startActivity(i);
}
}