@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); CookieSyncManager.createInstance(getApplicationContext()); mSettings.loadRedditPreferences(this, mClient); setRequestedOrientation(mSettings.getRotation()); setTheme(mSettings.getTheme()); requestWindowFeature(Window.FEATURE_PROGRESS); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); setContentView(R.layout.saved_comments); sdbh = new SavedDBHandler(this); savedContent = sdbh.getSavedContent(mSettings.getUsername()); Adapter lAdapter = new Adapter(this, R.layout.saved_comments_item, savedContent); listview = (ListView) findViewById(R.id.savedcommentslv); listview.setAdapter(lAdapter); listview.setOnItemClickListener( new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { currentSavedContent = savedContent.get(position); showDialog(Constants.DIALOG_SAVED_COMMENTS); } }); }
@Override protected void onResume() { super.onResume(); int prevTheme = mSettings.getTheme(); mSettings.loadRedditPreferences(this, mClient); if (mSettings.getTheme() != prevTheme) { relaunchActivity(); } else { CookieSyncManager.getInstance().startSync(); setRequestedOrientation(mSettings.getRotation()); if (mSettings.isLoggedIn()) new PeekEnvelopeTask(this, mClient, mSettings.getMailNotificationStyle()).execute(); } }