当前位置: 首页>>代码示例>>Java>>正文


Java Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT属性代码示例

本文整理汇总了Java中android.content.Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT属性的典型用法代码示例。如果您正苦于以下问题:Java Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT属性的具体用法?Java Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT怎么用?Java Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.content.Intent的用法示例。


在下文中一共展示了Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

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

    exitHelper = new ExitHelper(this);

    if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) {
        // Activity was brought to front and not created,
        // Thus finishing this will get us to the last viewed activity
        finish();
        return;
    }

    setContentView(R.layout.chat_sdk_activity_view_pager);

    firstTimeInApp();
    initViews();

    enableCheckOnlineOnResumed(true);

    if (!fromLoginActivity && savedInstanceState != null)
    {
        pager.setCurrentItem(savedInstanceState.getInt(PAGE_ADAPTER_POS));
    }

    mOpenFromPushChecker = new OpenFromPushChecker();
    if(mOpenFromPushChecker.checkOnCreate(getIntent(), savedInstanceState))
    {
        startChatActivityForID(getIntent().getExtras().getLong(ChatSDKAbstractChatActivity.THREAD_ID));
        return;
    }

}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:33,代码来源:ChatSDKMainActivity.java

示例2: onNewIntent

@Override
protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);


    if (System.currentTimeMillis() - mPauseTime < 1000  && Intent.ACTION_MAIN.equals(intent.getAction())) {

        final boolean alreadyOnHome =
                ((intent.getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT)
                        != Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
        Log.d("LaunchTime", " new intent " + alreadyOnHome);
        if (alreadyOnHome && !mChildLock) {

            // If we are on home screen, reset most things and go to top category.
            mCategoriesScroller.postDelayed(new Runnable() {
                @Override
                public void run() {
                    try {
                        mSearchBox.setSearchText("");
                        mCategoriesScroller.smoothScrollTo(0, 0);
                        showButtonBar(false, true);
                        mIconSheetScroller.smoothScrollTo(0, 0);
                        switchCategory(getTopCategory());
                        mQuickRow.scrollToStart();
                        mIconSheetScroller.smoothScrollTo(0, 0);
                        mCategoriesScroller.smoothScrollTo(0, 0);
                    } catch (Exception e) {
                        Log.e(TAG, e.getMessage(), e);
                    }

                }
            }, 200);
        }

    }
}
 
开发者ID:quaap,项目名称:LaunchTime,代码行数:36,代码来源:MainActivity.java

示例3: onCreate

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

    exitHelper = new ExitHelper(this);

    if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) {
        // Activity was brought to front and not created,
        // Thus finishing this will get us to the last viewed activity
        finish();
        return;
    }

    setContentView(R.layout.chat_sdk_activity_view_pager);

    firstTimeInApp();
    initViews();

    enableCheckOnlineOnResumed(true);

    if (!fromLoginActivity && savedInstanceState != null)
    {
        pager.setCurrentItem(savedInstanceState.getInt(PAGE_ADAPTER_POS));
    }

    mOpenFromPushChecker = new OpenFromPushChecker();
    if(mOpenFromPushChecker.checkOnCreate(getIntent(), savedInstanceState))
    {
        startChatActivityForID(getIntent().getExtras().getLong(ChatSDKAbstractChatActivity.THREAD_ID));
        return;
    }

    //// Added by zhang for interstitial ADS
    MobileAds.initialize(this, "ca-app-pub-2734020869575782/3654782558");

    mInterstitialAd = new InterstitialAd(this);
    mInterstitialAd.setAdUnitId(getString(R.string.full_ad_unit_id));

    mInterstitialAd.setAdListener(new AdListener() {
        @Override
        public void onAdLoaded(){
            super.onAdLoaded();
            if (mInterstitialAd.isLoaded())
                mInterstitialAd.show();
        }

        @Override
        public void onAdClosed() {

        }
    });

}
 
开发者ID:MobileDev418,项目名称:chat-sdk-android-push-firebase,代码行数:53,代码来源:ChatSDKMainActivity.java

示例4: onCreate

@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) {
            if(("application/pdf").equals(getIntent().getType())) {
                Uri data = getIntent().getData();
                Intent intent = new Intent(this,PdfPreviewActivity.class);
                intent.setDataAndType(data,getIntent().getType());
                startActivity(intent);
            }
            finish();
            return;
        }
        setContentView(R.layout.activity_splash);
        showSplashVideo();
        getViews();
        setViews();
        setListeners();
//        AppApi.postWaiterExtension(this,this,"waiter","101","101");
        startServerDiscoveryService();
        startJettyServer();
        getSmallPlatformUrl();
		uploadLogFile();
        reUploadWaiterData();
        OpenInstall.getInstall(new AppInstallListener() {
            @Override
            public void onInstallFinish(AppData appData, Error error) {
                if (error == null) {
                    //获取渠道数据
                    Log.d("SplashActivity", "channel = " + appData.getChannel());
                    //获取个性化安装数据
                    Log.d("SplashActivity", "install = " + appData.getData());
                    waiterData = appData.getData();
                    postWaiterToServer(waiterData);
                } else {
                    Log.d("SplashActivity", "error : "+error.toString());
                }
            }
        });

        startLocation();
        stopFirstUserServiceDelayed();
//        test();
    }
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:44,代码来源:SplashActivity.java


注:本文中的android.content.Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。