SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(ctx);
long uptimeMillis = SystemClock.uptimeMillis();
// Fix heap utilization for better heap size characteristics.
float TARGET_HEAP_UTILIZATION = 0.75f;
VMRuntime.getRuntime().setTargetHeapUtilization(TARGET_HEAP_UTILIZATION);
/*
* This method is called as a result of the user selecting the options menu
* to see the download window. It shows the download window on top of the
* current window.
*/
private void viewDownloads() {
Intent intent = new Intent(DownloadManager.ACTION_VIEW_DOWNLOADS);
startActivity(intent);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
switch (requestCode) {
case COMBO_PAGE:
if (resultCode == RESULT_OK && intent != null) {
String data = intent.getAction();
Bundle extras = intent.getExtras();
}
// Deliberately fall through to PREFERENCES_PAGE, since the
// same extra may be attached to the COMBO_PAGE
case PREFERENCES_PAGE:
if (resultCode == RESULT_OK && intent != null) {
String action = intent.getStringExtra(Intent.EXTRA_TEXT);
}
break;
// Choose a file from the file picker.
case FILE_SELECTED:
if (null == mUploadMessage)
break;
Uri result = intent == null || resultCode != RESULT_OK ? null : intent.getData();
break;
default:
break;
}
}