本文整理汇总了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;
}
}
示例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);
}
}
}
示例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() {
}
});
}
示例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();
}