Example usage for android.view Window FEATURE_INDETERMINATE_PROGRESS

List of usage examples for android.view Window FEATURE_INDETERMINATE_PROGRESS

Introduction

In this page you can find the example usage for android.view Window FEATURE_INDETERMINATE_PROGRESS.

Prototype

int FEATURE_INDETERMINATE_PROGRESS

To view the source code for android.view Window FEATURE_INDETERMINATE_PROGRESS.

Click Source Link

Document

Flag for indeterminate progress.

Usage

From source file:com.hsbadr.MultiSystem.MainActivity.java

@SuppressLint("NewApi")
@SuppressWarnings("deprecation")
@Override/*from w w w  .j a  v a2 s. co m*/
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.activity_main);

    /**
     * Before anything we need to check if the config files exist to avoid
     * FC is they don't
     *
     * @see #checkIfConfigExists()
     */
    checkIfConfigExists();

    /**
     * Now it's all good because if no configuration was found we have
     * copied a default one over.
     *
     * @see #checkIfConfigExists()
     */
    setAppConfigInPrefs();

    headers = getPluginTabs();

    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mDrawerList = (ListView) findViewById(R.id.left_drawer);

    /*
       * set a custom shadow that overlays the main content when the drawer
     * opens
     */
    mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);

    /* set up the drawer's list view with items and click listener */
    ArrayAdapter<String> pimpAdapter = new ArrayAdapter<String>(this, R.layout.drawer_list_item,
            mDrawerHeaders);
    mDrawerList.setAdapter(pimpAdapter);
    Log.e("FIRST POS", mDrawerList.getFirstVisiblePosition() + "");
    Log.e("LAST POS", mDrawerList.getLastVisiblePosition() + "");
    View child = mDrawerList.getChildAt(mDrawerList.getFirstVisiblePosition());
    if (child != null && android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
        child.setBackground(getColouredTouchFeedback());
    mDrawerList.setOnItemClickListener(new DrawerItemClickListener());

    /** Set the user-defined ActionBar icon */
    File file = new File(getFilesDir() + "/.MultiSystem/icon.png");
    if (file.exists()) {
        try {
            getSupportActionBar().setDisplayHomeAsUpEnabled(true);
            getSupportActionBar().setHomeButtonEnabled(true);
            Uri iconUri = Uri.fromFile(new File(getFilesDir() + "/.MultiSystem/icon.png"));
            Bitmap icon = BitmapFactory.decodeFile(iconUri.getPath());
            Drawable ic = new BitmapDrawable(icon);
            getSupportActionBar().setIcon(ic);
        } catch (NullPointerException e) {
            Log.e("NPE", e.getMessage());
        }
    }
    /*
     * ActionBarDrawerToggle ties together the proper interactions between
    * the sliding drawer and the action bar app icon
    */
    mDrawerToggle = new ActionBarDrawerToggle(this, /* host Activity */
            mDrawerLayout, /* DrawerLayout object */
            R.drawable.ic_drawer, /* nav drawer image to replace 'Up' caret */
            R.string.app_name, /* "open drawer" description for accessibility */
            R.string.app_name /* "close drawer" description for accessibility */
    ) {
        public void onDrawerClosed(View view) {
            invalidateOptionsMenu(); /*
                                     * creates call to
                                     * onPrepareOptionsMenu()
                                     */

        }

        public void onDrawerOpened(View drawerView) {
            invalidateOptionsMenu(); /*
                                     * creates call to
                                     * onPrepareOptionsMenu()
                                     */
        }
    };
    mDrawerLayout.setDrawerListener(mDrawerToggle);

    /** Tabs adapter using the PagerSlidingStrip library */
    tabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
    pager = (ViewPager) findViewById(R.id.pager);
    MyPagerAdapter adapter = new MyPagerAdapter(this.getSupportFragmentManager());
    pager.setAdapter(adapter);
    pager.setOnPageChangeListener(new OnPageChangeListener() {

        @Override
        public void onPageSelected(int arg0) {
        }

        @Override
        public void onPageScrolled(int arg0, float arg1, int arg2) {
        }

        @Override
        public void onPageScrollStateChanged(int arg0) {
        }
    });

    final int pageMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 4,
            getResources().getDisplayMetrics());
    pager.setPageMargin(pageMargin);

    tabs.setViewPager(pager);
    tabs.setOnPageChangeListener(this);

    changeColor(Color.parseColor(getPluginColor()));
    pager.setOffscreenPageLimit(5);
}

From source file:com.cuddlesoft.nori.ImageViewerActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Get shared preferences.
    sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);

    // Get data out of Intent sent by SearchActivity or restore them from the saved instance
    // state./*from   ww  w . ja v  a  2 s .c o m*/
    int imageIndex;
    if (savedInstanceState != null && savedInstanceState.containsKey(BUNDLE_ID_IMAGE_INDEX)
            && savedInstanceState.containsKey(BUNDLE_ID_SEARCH_RESULT)) {
        imageIndex = savedInstanceState.getInt(BUNDLE_ID_IMAGE_INDEX);
        searchResult = savedInstanceState.getParcelable(BUNDLE_ID_SEARCH_RESULT);
        searchClient = ((SearchClient.Settings) savedInstanceState
                .getParcelable(BUNDLE_ID_SEARCH_CLIENT_SETTINGS)).createSearchClient();
    } else {
        final Intent intent = getIntent();
        imageIndex = intent.getIntExtra(SearchActivity.BUNDLE_ID_IMAGE_INDEX, 0);
        searchResult = intent.getParcelableExtra(SearchActivity.BUNDLE_ID_SEARCH_RESULT);
        searchClient = ((SearchClient.Settings) intent
                .getParcelableExtra(SearchActivity.BUNDLE_ID_SEARCH_CLIENT_SETTINGS)).createSearchClient();
    }

    // Request window features.
    supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    // Keep screen on, if enabled by the user.
    if (sharedPreferences.getBoolean(getString(R.string.preference_image_viewer_keepScreenOn_key), true)) {
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    }

    // Populate content view.
    setContentView(R.layout.activity_image_viewer);

    // Set up the action bar.
    final ActionBar actionBar = getSupportActionBar();
    actionBar.hide();
    actionBar.setDisplayShowHomeEnabled(false);
    actionBar.setDisplayHomeAsUpEnabled(true);

    // Create and set the image viewer Fragment pager adapter.
    imagePagerAdapter = new ImagePagerAdapter(getSupportFragmentManager());
    viewPager = (ImageViewerPager) findViewById(R.id.image_pager);
    viewPager.setAdapter(imagePagerAdapter);
    viewPager.setOnPageChangeListener(this);
    viewPager.setCurrentItem(imageIndex);

    // Set up the GestureDetector used to toggle the action bar.
    gestureDetector = new GestureDetector(this, gestureListener);
    viewPager.setOnMotionEventListener(this);

    // Set activity title.
    setTitle(searchResult.getImages()[imageIndex]);

    // Dim system UI.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        viewPager.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
    }
}

From source file:com.prasanna.android.stacknetwork.QuestionActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    super.onCreate(savedInstanceState);

    setContentView(R.layout.viewpager_title_indicator);

    resultReceiver = new RestQueryResultReceiver(new Handler());
    resultReceiver.setReceiver(this);

    if (questionFragment == null)
        questionFragment = QuestionFragment.newFragment();

    setupViewPager();//  w ww  .  j a v  a2s .  c  om

    if (savedInstanceState != null && savedInstanceState.getSerializable(StringConstants.QUESTION) != null)
        question = (Question) savedInstanceState.getSerializable(StringConstants.QUESTION);
    else
        prepareIntentAndStartService();
}

From source file:com.ogunwale.android.app.yaps.ui.PhotosActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    mSourceSelection = SettingsManager.getInstance(getApplicationContext()).getAlbumSelection();

    setContentView(R.layout.activity_photos);

    // Set-up cursor adapter
    mAdapter = new PhotosSimpleCursorAdapter(this);

    // Set-up thumbnail grid
    mGridView = (TwoWayGridView) findViewById(R.id.photo_gridview);
    mGridView.setAdapter(mAdapter);//from  www. j a v a2 s  .c o m
    mGridView.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(TwoWayAdapterView<?> parent, View view, int position, long id) {
            Cursor cursor = mAdapter.getCursor();
            if (cursor.moveToPosition(position)) {
                DialogFragment df = TransferDialogFragment.newInstance(cursor, id);
                df.show(getFragmentManager(), "transfer_dialog");
            } else {
                Log.e(sTAG, "Can not move cursor to: " + position);
            }
        }
    });

    // Prepare the database loader.
    getLoaderManager().initLoader(0, null, this);

    // Register for local broadcasts
    IntentFilter iFilter = new IntentFilter();
    iFilter.addAction(Extras.ACTION_SET_PHOTO_SOURCE_FACEBOOK);
    iFilter.addAction(Extras.ACTION_SET_PHOTO_SOURCE_PICASA);
    iFilter.addAction(Extras.ACTION_REMOTE_ALBUM_REQUEST_COMPLETE);
    LocalBroadcastManager.getInstance(getApplicationContext()).registerReceiver(mLocalBroadcastReceiver,
            iFilter);
}

From source file:it.imwatch.nfclottery.MainActivity.java

@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
@SuppressLint("ResourceAsColor")
@Override//  w ww .  ja va  2  s  .  com
protected void onCreate(Bundle savedInstanceState) {
    // Initialize the progress bar on the actionbar
    // Must be done BEFORE setContentView, then hidden
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_main);
    mTxtStatus = (TextView) findViewById(R.id.txt_status);
    mTxtNfcScan = (TextView) findViewById(R.id.txt_nfc_scan);

    getSupportActionBar().setIcon(getResources().getDrawable(R.drawable.ic_actionbar_logo));

    mHandler = new Handler();

    // Only show the error toast (when necessary) if the saved instance state
    // doesn't tell us not to show it
    final boolean showUi = savedInstanceState == null
            || !savedInstanceState.getBoolean(EXTRA_NO_NFC_CHECK_ERR, false);

    if (isNfcAvailable(showUi)) {
        mTxtNfcScan.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(android.provider.Settings.ACTION_NFC_SETTINGS));
            }
        });
    } else {
        // isNfcAvailable() shows an error Toast by itself in case of need
        Log.w(TAG, "This device doesn't support NFC");
    }

    updateParticipantsCount();
    setShowsRefreshUi(false);

    addDropboxMenuFragment();

    handleIntent(getIntent());
}

From source file:com.itude.mobile.mobbl.core.controller.MBViewManager.java

@Override
protected void onCreate(android.os.Bundle savedInstanceState) {
    onPreCreate();//  w w w  .j av  a  2  s.  com

    _actionBarBuilder = constructActionBarBuilder();

    _dialogManager = new MBDialogManager(this);

    _homeButtonHandler = new DefaultHomeButtonHandler();

    /*
     *  We store our default orientation. This will be used to determine how pages should be shown by default
     *  See setOrientation
     */
    _defaultScreenOrientation = getRequestedOrientation();

    super.onCreate(null);

    supportRequestWindowFeature(Window.FEATURE_PROGRESS);
    supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    // makes sure the action bar is initialized (otherwise, the setProgressBar.. doesn't work)
    if (getSupportActionBar() != null) {
        setSupportProgressBarIndeterminateVisibility(false);
    }

    getDialogManager().addDialogChangeListener(this);

    _instance = this;

    MBApplicationController.getInstance().startController();
}

From source file:com.kiddobloom.bucketlist.AuthenticatorActivity.java

/**
 * {@inheritDoc}//from   www. j  a  v  a2  s.c  o  m
 */
@Override
public void onCreate(Bundle icicle) {

    Intent intent = getIntent();
    bucketListTab = intent.getIntExtra("com.kiddobloom.bucketlist.current_tab", 0);

    //Log.d("tagaa", "authenticator activity oncreate - bucketListTab: " + bucketListTab);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    super.onCreate(icicle);
    setProgressBarIndeterminateVisibility(false);

    uiHelper = new UiLifecycleHelper(this, callback);
    uiHelper.onCreate(icicle);

    //getActionBar().setTitle(getResources().getString(R.string.app_name));
    getActionBar().setTitle("Bucket List");
    getActionBar().setSubtitle("by kiddoBLOOM");

    sp = getSharedPreferences(getString(R.string.pref_name), MODE_PRIVATE);
    am = AccountManager.get(this);
    myApp = (MyApplication) getApplication();

    // reset the sync flag to trigger re-sync
    saveInitialSynced(false);
}

From source file:com.sintef_energy.ubisolar.activities.DrawerActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    //We want to use the progress bar
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    Global.BROADCAST_NAV_DRAWER = getResources().getString(R.string.broadcast_nav_drawer_usage);

    //Create RequestManager instance
    try {/*from   w  w  w . j  av  a2 s.  c  o  m*/
        RequestManager.getInstance();
    } catch (IllegalStateException e) {
        RequestManager.getInstance(getApplicationContext());
    }

    /* Setup preference manager */
    try {
        mPrefManager = PreferencesManager.getInstance();
    } catch (IllegalStateException ex) {
        mPrefManager = PreferencesManager.initializeInstance(getApplicationContext());
    }

    /* Set up the presenters */
    mTotalEnergyPresenter = new TotalEnergyPresenter();
    devicePresenter = new DevicePresenter();
    residencePresenter = new ResidencePresenter();
    userPresenter = new UserPresenter();

    titleNames = getResources().getStringArray(R.array.nav_drawer_items);
    setContentView(R.layout.activity_usage);

    mNavigationDrawerFragment = (NavigationDrawerFragment) getFragmentManager()
            .findFragmentById(R.id.navigation_drawer);
    mTitle = getTitle();

    // Set up the drawer.
    mNavigationDrawerFragment.setUp(R.id.navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout));

    /* Update UX on back stack change */
    getFragmentManager().addOnBackStackChangedListener(new FragmentManager.OnBackStackChangedListener() {
        public void onBackStackChanged() {
            // Update your UI here.
            int count = getFragmentManager().getBackStackEntryCount();

            // Only show nav drawer when there is nothing on the back stack
            if (count > 0)
                mNavigationDrawerFragment.setNavDrawerToggle(false);
            else
                mNavigationDrawerFragment.setNavDrawerToggle(true);
        }
    });

    /* Session data callback */
    mFacebookSessionStatusCallback = new FacebookSessionStatusCallback();

    /* Setup dummy account */
    AUTHORITY_PROVIDER = getResources().getString(R.string.provider_authority_energy);
    ACCOUNT_TYPE = getResources().getString(R.string.auth_account_type);
    ACCOUNT = getResources().getString(R.string.app_name);

    //mAccount = CreateSyncAccount(this);
    startFacebookLogin(savedInstanceState);

    /* DEVELOPER SETTINGS */

    // Extra logging for debug
    if (Global.DEVELOPER_MADE)
        Settings.addLoggingBehavior(LoggingBehavior.INCLUDE_ACCESS_TOKENS);

    //Creates the Total usage device if it does not already exist.
    Utils.createTotal(getContentResolver(), this);

    /* Start developer mode after app has been setup
     * Lots of StrictMode violations are done in startup anyways. */
    Utils.developerMode(getContentResolver(), Global.DEVELOPER_MADE, false);
}

From source file:jupiter.broadcasting.live.holo.JBPlayer.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    final Context ct = this;
    String ns = NOTIFICATION_SERVICE;
    mNotificationManager = (NotificationManager) getSystemService(ns);
    nReceiver = new BroadcastReceiver() {
        @Override/*  w  w  w .j  a v a 2 s .  c o  m*/
        public void onReceive(Context context, Intent intent) {
            String action = intent.getAction();
            if (action != null) {
                if (action.equalsIgnoreCase("PLAY_PAUSE")) {
                    if (mp.isPlaying()) {
                        mp.pause();
                        unregisterReceiver(nReceiver);
                        putNotificationUp(mp.isPlaying());
                    } else {
                        mp.start();
                        unregisterReceiver(nReceiver);
                        putNotificationUp(mp.isPlaying());
                    }
                } else if (action.equalsIgnoreCase("STOP")) {
                    unregisterReceiver(nReceiver);
                    mNotificationManager.cancel(NOTIFICATION_ID);
                    mp.stop();
                    start = false;
                }
            }
        }
    };

    //check if network notification is disabled in settings
    SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
    notify = sharedPref.getBoolean("pref_sync_audio", false);

    mVideoCastManager = JBApplication.getVideoCastManager(this);
    mVideoCastManager.reconnectSessionIfPossible(this, true);

    supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.mediaplayer);

    type = getIntent().getIntExtra("type", 3);
    title = getIntent().getStringExtra("title");
    pic = "http://jb4.cdn.scaleengine.net/wp-content/themes/jb2014/images/logo.png";
    hasit = HasIt(title, av);
    getSupportActionBar().setTitle(title);
    mDecorView = getWindow().getDecorView();
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
        mDecorView.setOnSystemUiVisibilityChangeListener(this);

    // going on different routes if coming from Catalogue/Home/EpisodeList
    offline = getIntent().getBooleanExtra("offline", false);
    String help = getIntent().getStringExtra("loc");
    live = ((help != null) && help.equalsIgnoreCase("-1"));
    if (!offline && !hasit) {
        pic = getIntent().getStringExtra("pic");
        aLink = getIntent().getStringExtra("aLink");
        vLink = getIntent().getStringExtra("vLink");
        theLink = aLink;
        GetSize newSize = new GetSize();
        newSize.execute();
    } else if (!live) {
        theLink = getIntent().getStringExtra("loc");
    } else {
        aLink = getIntent().getStringExtra("aLink");
        vLink = getIntent().getStringExtra("vLink");
        theLink = aLink;
    }

    iView = (FadeImageView) findViewById(R.id.thumb);
    RequestQueue mReqQue = Volley.newRequestQueue(getApplicationContext());
    ImageLoader mImageLoader = new ImageLoader(mReqQue, new BitmapLruCache());

    if (!offline) {
        iView.setImageUrl(pic, mImageLoader);
    }
    if (offline && !live) {
        switch (type) {
        case 0:
            SpinnerArray.add(getString(R.string.audio));
            break;
        case 1:
            SpinnerArray.add(getString(R.string.video));
            break;
        }
    } else {
        SpinnerArray.add(getString(R.string.audio));
        SpinnerArray.add(getString(R.string.video));
    }
    spinner = (Spinner) findViewById(R.id.AV);
    ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item,
            SpinnerArray);
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    spinner.setAdapter(adapter);
    spinner.setOnItemSelectedListener(this);

    tw = (TextView) findViewById(R.id.summary);
    tw.setMovementMethod(new ScrollingMovementMethod());
    tw.setText(getIntent().getStringExtra("sum"));

    play = (Button) findViewById(R.id.player);
    play.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            ConnectivityManager connectivity = (ConnectivityManager) getSystemService(
                    Context.CONNECTIVITY_SERVICE);
            wifiInfo = connectivity.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
            if ((wifiInfo == null || wifiInfo.getState() != NetworkInfo.State.CONNECTED) && !hasit && notify) {
                AlertDialog.Builder myAlertDialog = new AlertDialog.Builder(ct);
                myAlertDialog.setTitle(R.string.alert);
                myAlertDialog.setMessage(R.string.areyousure2);
                myAlertDialog.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface arg0, int arg1) {
                        if (av == 1) //video
                            StartPlay(theLink);
                        else //audio
                            try {
                                StartPlayBackground(theLink);
                            } catch (IOException e) {
                                e.printStackTrace();
                            }
                    }
                });
                myAlertDialog.setNegativeButton(getString(R.string.cancel),
                        new DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface arg0, int arg1) {
                            }
                        });
                myAlertDialog.show();
            } else {
                if (av == 1) //video
                    StartPlay(theLink);
                else //audio
                    try {
                        StartPlayBackground(theLink);
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
            }

        }
    });

    down = (Button) findViewById(R.id.downer);
    if (offline || hasit) {
        down.setVisibility(View.INVISIBLE);
    }
    down.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            final String url = theLink;
            //if wifi not connected, ask to make sure
            ConnectivityManager connectivity = (ConnectivityManager) getSystemService(
                    Context.CONNECTIVITY_SERVICE);
            wifiInfo = connectivity.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
            if ((wifiInfo == null || wifiInfo.getState() != NetworkInfo.State.CONNECTED) && notify) {
                AlertDialog.Builder myAlertDialog = new AlertDialog.Builder(ct);
                myAlertDialog.setTitle(R.string.alert);
                myAlertDialog.setMessage(R.string.areyousure2);
                myAlertDialog.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface arg0, int arg1) {
                        DownLoad(url);
                    }
                });
                myAlertDialog.setNegativeButton(getString(R.string.cancel),
                        new DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface arg0, int arg1) {
                            }
                        });
                myAlertDialog.show();
            } else {
                DownLoad(url);
            }

        }
    });
}

From source file:li.barter.activities.AbstractBarterLiActivity.java

@Override
protected void onCreate(final Bundle savedInstanceState) {
    getWindow().requestFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    super.onCreate(savedInstanceState);

    mMultipaneLayout = getResources().getBoolean(R.bool.multipane);

    /* Here, getClass() might show an Ambiguous method call bug. It's a bug in IntelliJ IDEA 13
    * http://youtrack.jetbrains.com/issue/IDEA-72835 */
    mActivityTransition = getClass().getAnnotation(ActivityTransition.class);

    long lastScreenTime = 0l;
    if (savedInstanceState == null) {
        if (mActivityTransition != null) {
            overridePendingTransition(mActivityTransition.createEnterAnimation(),
                    mActivityTransition.createExitAnimation());
        }/*w  w  w  . j  av  a2 s . co  m*/
    } else {
        lastScreenTime = savedInstanceState.getLong(Keys.LAST_SCREEN_TIME);
    }

    if (Utils.shouldReportScreenHit(lastScreenTime)) {
        mShouldReportScreenHit = true;
    } else {
        mShouldReportScreenHit = false;
    }

    if (getSupportActionBar() != null) {
        getSupportActionBar().setDisplayOptions(ACTION_BAR_DISPLAY_MASK);
        setActionBarTitle(getTitle().toString());
    }

    final RequestQueue requestQueue = ((IVolleyHelper) getApplication()).getRequestQueue();

    mVolleyCallbacks = new VolleyCallbacks(requestQueue, this);
    mRequestCounter = new AtomicInteger(0);
    setProgressBarIndeterminateVisibility(false);
}