コード例 #1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    CookieSyncManager.createInstance(getApplicationContext());

    mSettings.loadRedditPreferences(this, mClient);
    setRequestedOrientation(mSettings.getRotation());
    requestWindowFeature(Window.FEATURE_PROGRESS);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    resetUI(null);

    mSubredditsList = cacheSubredditsList(mSubredditsList);

    if (CollectionUtils.isEmpty(mSubredditsList)) restoreLastNonConfigurationInstance();

    if (CollectionUtils.isEmpty(mSubredditsList)) {
      new DownloadRedditsTask().execute();
    } else {
      addFakeSubredditsUnlessSuppressed();
      resetUI(new PickSubredditAdapter(this, mSubredditsList));
    }
  }
コード例 #2
0
 @Override
 public void onCreate() {
   mNM = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
   mSettings.loadRedditPreferences(this, mClient);
   new PeekEnvelopeServiceTask(this, mClient, mSettings.getMailNotificationStyle()).execute();
 }