List of usage examples for android.content Intent FLAG_ACTIVITY_REORDER_TO_FRONT
int FLAG_ACTIVITY_REORDER_TO_FRONT
To view the source code for android.content Intent FLAG_ACTIVITY_REORDER_TO_FRONT.
Click Source Link
From source file:com.zira.registration.BackgroundCheckActivity.java
@Override public void onBackPressed() { Intent intent = new Intent(BackgroundCheckActivity.this, VehicleInformationActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); startActivity(intent);/* ww w . j ava 2 s .c o m*/ }
From source file:com.cssweb.android.common.FairyUI.java
/** * ??\/*w w w .java 2 s . c o m*/ * * @param paramInt * @param paramContext * @return */ public static Intent genIsLoginIntent(int paramInt, int paramInt2, Context paramContext) { Intent localIntent = new Intent(); if (genIsActiveIntent(paramInt, paramInt2, paramContext)) { if (!TradeUtil.checkUserLogin()) {// ? localIntent.putExtra("menu_id", paramInt); localIntent.setClass(paramContext, LoginActivity.class); } else { localIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); String orgid = TradeUser.getInstance().getOrgid(); switch (paramInt2) { case Global.NJZQ_JLP_JYYH: localIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); localIntent.putExtra("menu_id", paramInt2); if (1 == TradeUser.getInstance().getLoginType()) { localIntent = null; } else { localIntent.setClass(paramContext, LoginActivity.class); } break; case Global.NJZQ_WTJY: localIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); localIntent.putExtra("menu_id", paramInt2); if (orgid == null || "".equals(orgid)) { localIntent.setClass(paramContext, LoginActivity.class); } else { localIntent.setClass(paramContext, JlpActivity.class); } break; case Global.NJZQ_WTJY_TWO: localIntent.putExtra("menu_id", Global.NJZQ_WTJY_GP_THREE); localIntent.setClass(paramContext, FundActivity.class); break; case Global.QUOTE_USERSTK: localIntent.putExtra("requestType", 1); localIntent.setClass(paramContext, PersonalStock.class); break; case Global.QUOTE_WARNING: case Global.NJZQ_HQBJ_HQYJ: if (TradeUser.getInstance().getLoginType() == 3) { localIntent.putExtra("menu_id", paramInt); localIntent.setClass(paramContext, LoginActivity.class); } else localIntent.setClass(paramContext, QuoteWarning.class); break; case Global.NJZQ_ZXHD_EGHT: localIntent.putExtra("menu_id", Global.NJZQ_ZXHD_EGHT); localIntent.setClass(paramContext, VistualTrade.class); break; case Global.QUOTE_PAIMING: localIntent.putExtra("requestType", 0); localIntent.setClass(paramContext, PaiMing.class); break; case Global.QUOTE_DAPAN: localIntent.putExtra("requestType", 2); localIntent.setClass(paramContext, DaPan.class); break; case Global.NJZQ_HQBJ_QQSC_WHSC: localIntent.putExtra("menu_id", Global.NJZQ_HQBJ_QQSC_WHSC); localIntent.setClass(paramContext, GlobalMarket.class); break; case Global.QUOTE_FENLEI: localIntent.putExtra("requestType", 2); localIntent.setClass(paramContext, FenLei.class); break; case Global.QUOTE_STOCK: localIntent.putExtra("type", 0); localIntent.setClass(paramContext, StockTypeFund.class); break; case Global.QUOTE_BOND: localIntent.putExtra("type", 1); localIntent.setClass(paramContext, StockTypeFund.class); break; case Global.QUOTE_MONETARY: localIntent.putExtra("type", 2); localIntent.setClass(paramContext, StockTypeFund.class); break; case Global.QUOTE_MIX: localIntent.putExtra("type", 3); localIntent.setClass(paramContext, StockTypeFund.class); break; case Global.SUN_PRIVATE: localIntent.putExtra("type", 4); localIntent.setClass(paramContext, SunPrivate.class); break; case Global.HK_MAINBOARD: // ? Bundle bundle = new Bundle(); bundle.putInt("stocktype", 101); bundle.putInt("flag", 1); localIntent.putExtras(bundle); localIntent.setClass(paramContext, HKMainboard.class); break; case Global.HK_CYB: // ? Bundle bundle2 = new Bundle(); bundle2.putInt("stocktype", 102); bundle2.putInt("flag", 2); localIntent.putExtras(bundle2); localIntent.setClass(paramContext, HKMainboard.class); break; case Global.ZJS:// localIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); localIntent.setClass(paramContext, ZJS.class); Bundle extras = new Bundle(); extras.putString("market", "cffex"); extras.putString("exchange", "cf"); extras.putString("title", ""); localIntent.putExtras(extras); break; case Global.SDZ:// ,, localIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); localIntent.setClass(paramContext, QHSCBaseActivity.class); break; case Global.QUOTE_HSZS: localIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); localIntent.setClass(paramContext, HSZS.class); break; case Global.QUOTE_KLINE: localIntent.setClass(paramContext, KLineActivity.class); break; case Global.QUOTE_FENSHI: localIntent.putExtra("exchange", CssSystem.exchange); localIntent.putExtra("stockcode", CssSystem.stockcode); localIntent.putExtra("stockname", CssSystem.stockname); localIntent.setClass(paramContext, TrendActivity.class); break; case Global.NJZQ_ZXHD_KHJL: localIntent.putExtra("pos", Global.NJZQ_ZXHD_KHJL); localIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); localIntent.setClass(paramContext, WebViewDisplay.class); break; case Global.NJZQ_ZXHD_TZGW: if (TradeUser.getInstance().getLoginType() == 3) { localIntent.putExtra("menu_id", paramInt); localIntent.setClass(paramContext, LoginActivity.class); } else { localIntent.putExtra("pos", Global.NJZQ_ZXHD_TZGW); localIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); localIntent.setClass(paramContext, WebViewDisplay.class); } break; } } } else { localIntent.putExtra("menu_id", paramInt); if (paramInt == Global.NJZQ_WTJY) { localIntent.putExtra("isChangeBtn", true); } localIntent.setClass(paramContext, SMSJHActivity.class); } return localIntent; }
From source file:org.mariotaku.twidere.fragment.AccountsDashboardFragment.java
@Override public boolean onNavigationItemSelected(MenuItem item) { final ParcelableAccount account = mAccountsAdapter.getSelectedAccount(); if (account == null) return false; switch (item.getItemId()) { case R.id.search: { final Intent intent = new Intent(getActivity(), QuickSearchBarActivity.class); intent.putExtra(EXTRA_ACCOUNT_KEY, account.account_key); startActivity(intent);/*from w w w. j a va 2s .c o m*/ closeAccountsDrawer(); break; } case R.id.compose: { final Intent composeIntent = new Intent(INTENT_ACTION_COMPOSE); composeIntent.setClass(getActivity(), ComposeActivity.class); composeIntent.putExtra(EXTRA_ACCOUNT_KEY, account.account_key); startActivity(composeIntent); break; } case R.id.favorites: { IntentUtils.openUserFavorites(getActivity(), account.account_key, account.account_key, account.screen_name); break; } case R.id.lists: { IntentUtils.openUserLists(getActivity(), account.account_key, account.account_key, account.screen_name); break; } case R.id.groups: { IntentUtils.openUserGroups(getActivity(), account.account_key, account.account_key, account.screen_name); break; } case R.id.public_timeline: { IntentUtils.openPublicTimeline(getActivity(), account.account_key); break; } case R.id.messages: { IntentUtils.openDirectMessages(getActivity(), account.account_key); break; } case R.id.interactions: { IntentUtils.openInteractions(getActivity(), account.account_key); break; } case R.id.edit: { IntentUtils.openProfileEditor(getActivity(), account.account_key); break; } case R.id.accounts: { IntentUtils.openAccountsManager(getActivity()); closeAccountsDrawer(); break; } case R.id.drafts: { IntentUtils.openDrafts(getActivity()); closeAccountsDrawer(); break; } case R.id.filters: { IntentUtils.openFilters(getActivity()); closeAccountsDrawer(); break; } case R.id.plus_service: { final Intent intent = new Intent(getActivity(), PlusServiceDashboardActivity.class); startActivity(intent); closeAccountsDrawer(); break; } case R.id.settings: { final Intent intent = new Intent(getActivity(), SettingsActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); startActivityForResult(intent, REQUEST_SETTINGS); closeAccountsDrawer(); break; } } return false; }
From source file:org.voidsink.anewjkuapp.utils.AppUtils.java
public static void showEventLocation(Context context, String location) { Intent intent = new Intent(context, MainActivity.class) .putExtra(MainActivity.ARG_SHOW_FRAGMENT_ID, R.id.nav_map) .putExtra(MainActivity.ARG_SAVE_LAST_FRAGMENT, false).setAction(Intent.ACTION_SEARCH) .addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); if (!TextUtils.isEmpty(location)) { intent.putExtra(SearchManager.QUERY, location); intent.putExtra(MainActivity.ARG_EXACT_LOCATION, true); } else {/*from w w w . j av a 2 s . c om*/ intent.putExtra(SearchManager.QUERY, "Uniteich"); } context.startActivity(intent); }
From source file:cc.mintcoin.wallet.service.BlockchainServiceImpl.java
@Override public int onStartCommand(final Intent intent, final int flags, final int startId) { log.info("service start command: " + intent + (intent.hasExtra(Intent.EXTRA_ALARM_COUNT) ? " (alarm count: " + intent.getIntExtra(Intent.EXTRA_ALARM_COUNT, 0) + ")" : "")); //log.info("org.bitcoin.NativeSecp256k1.enabled=" + org.bitcoin.NativeSecp256k1.enabled); if (blockChain == null) { boolean blockChainFileExists = blockChainFile.exists(); boolean tryStarting = true; if (DownloadCompleteReceiver.isDownloading(application)) { log.info("isDownloading"); DownloadCompleteReceiver.updateDownloadState(application); // it can fix itself this way tryStarting = false;//from w w w . j a v a 2 s . c o m } else if (!blockChainFileExists) { if (DownloadCompleteReceiver.isObbAvailable(application)) { initializeBlockchainFast(); tryStarting = true; } else if (intent.getBooleanExtra(DownloadCompleteReceiver.INTENT_EXTRA_SKIP_OBB_INIT, false)) { tryStarting = true; } else { // open dialog box to ask user what to do for download Intent intent2 = new Intent(this, InitialBlockchainActivity.class); intent2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); startActivity(intent2); tryStarting = false; } } if (tryStarting) { try { startBlockChain(); } catch (Error e) { stopSelf(); throw e; } } else { stopSelf(); } } String action = intent.getAction(); if (BlockchainService.ACTION_CANCEL_COINS_RECEIVED.equals(action)) { notificationCount = 0; notificationAccumulatedAmount = BigInteger.ZERO; notificationAddresses.clear(); nm.cancel(NOTIFICATION_ID_COINS_RECEIVED); } else if (BlockchainService.ACTION_RESET_BLOCKCHAIN.equals(action)) { log.info("will remove blockchain on service shutdown"); resetBlockchainOnShutdown = true; stopSelf(); } else if (BlockchainService.ACTION_BROADCAST_TRANSACTION.equals(action)) { final Sha256Hash hash = new Sha256Hash( intent.getByteArrayExtra(BlockchainService.ACTION_BROADCAST_TRANSACTION_HASH)); final Transaction tx = application.getWallet().getTransaction(hash); if (peerGroup != null) { log.info("broadcasting transaction " + tx.getHashAsString()); peerGroup.broadcastTransaction(tx); } else { log.info("peergroup not available, not broadcasting transaction " + tx.getHashAsString()); } } return START_NOT_STICKY; }
From source file:com.onesignal.OneSignal.java
private static void fireIntentFromNotificationOpen(Context inContext, JSONArray data) { PackageManager packageManager = inContext.getPackageManager(); boolean isCustom = false; Intent intent = new Intent().setAction("com.onesignal.NotificationOpened.RECEIVE") .setPackage(inContext.getPackageName()); List<ResolveInfo> resolveInfo = packageManager.queryBroadcastReceivers(intent, PackageManager.GET_INTENT_FILTERS); if (resolveInfo.size() > 0) { intent.putExtra("onesignal_data", data.toString()); inContext.sendBroadcast(intent); isCustom = true;//from www . j a va2 s . co m } // Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. resolveInfo = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); if (resolveInfo.size() > 0) { if (!isCustom) intent.putExtra("onesignal_data", data.toString()); isCustom = true; intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK); inContext.startActivity(intent); } if (!isCustom) { try { ApplicationInfo ai = inContext.getPackageManager().getApplicationInfo(inContext.getPackageName(), PackageManager.GET_META_DATA); Bundle bundle = ai.metaData; String defaultStr = bundle.getString("com.onesignal.NotificationOpened.DEFAULT"); isCustom = "DISABLE".equals(defaultStr); } catch (Throwable t) { Log(LOG_LEVEL.ERROR, "", t); } } if (!isCustom) { Intent launchIntent = inContext.getPackageManager() .getLaunchIntentForPackage(inContext.getPackageName()); if (launchIntent != null) { launchIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK); inContext.startActivity(launchIntent); } } }
From source file:com.zhenlaidian.ui.InputCarNumberActivity.java
private void takePhoto(int num) { // ??SD??/*from w w w .j a va 2s .c o m*/ Constant.ISNEEDBACKUP = false; File picFile = null; String SDState = Environment.getExternalStorageState(); if (SDState.equals(Environment.MEDIA_MOUNTED)) { File dir = new File(Environment.getExternalStorageDirectory() + "/TingCheBao"); if (!dir.exists()) { dir.mkdirs(); } SimpleDateFormat dateaf = new SimpleDateFormat("yyyyMMddHHmm"); String filename = dateaf.format(System.currentTimeMillis()) + num + ".jpeg"; picFile = new File(dir.getAbsolutePath(), filename); files.add(picFile); MyLog.i("INCarDialogActivity", "picFile=" + picFile); Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.Images.Media.ORIENTATION, 0); intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Uri.fromFile(picFile)); intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); startActivityForResult(intent, 10); MyLog.i("INCarDialogActivity", "startActivityForResult(intent, 10)"); // ??1?onActivityResultrequestCode0??? } else { Toast.makeText(this, "??", Toast.LENGTH_LONG).show(); } }
From source file:co.beem.project.beem.FacebookTextService.java
private PendingIntent makeChatIntent(User user) { Intent chatIntent = new Intent(FacebookTextService.this, FbTextMainActivity.class); chatIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); try {//from ww w . ja v a 2s.c om chatIntent.setData(user.toUri()); } catch (Exception e) { Log.e(TAG, e.getMessage()); } PendingIntent contentIntent = PendingIntent.getActivity(FacebookTextService.this, 0, chatIntent, PendingIntent.FLAG_UPDATE_CURRENT); return contentIntent; }
From source file:com.xandy.calendar.AllInOneActivity.java
@Override public void handleEvent(EventInfo event) { long displayTime = -1; if (event.eventType == EventType.GO_TO) { if ((event.extraLong & CalendarController.EXTRA_GOTO_BACK_TO_PREVIOUS) != 0) { mBackToPreviousView = true;//from w ww . j a va 2s . c om } else if (event.viewType != mController.getPreviousViewType() && event.viewType != ViewType.EDIT) { // Clear the flag is change to a different view type mBackToPreviousView = false; } setMainPane(null, R.id.main_pane, event.viewType, event.startTime.toMillis(false), false); if (mSearchView != null) { mSearchView.clearFocus(); } if (mShowCalendarControls) { int animationSize = (mOrientation == Configuration.ORIENTATION_LANDSCAPE) ? mControlsAnimateWidth : mControlsAnimateHeight; boolean noControlsView = event.viewType == ViewType.MONTH || event.viewType == ViewType.AGENDA; if (mControlsMenu != null) { mControlsMenu.setVisible(!noControlsView); mControlsMenu.setEnabled(!noControlsView); } if (noControlsView || mHideControls) { // hide minimonth and calendar frag mShowSideViews = false; if (!mHideControls) { final ObjectAnimator slideAnimation = ObjectAnimator.ofInt(this, "controlsOffset", 0, animationSize); slideAnimation.addListener(mSlideAnimationDoneListener); slideAnimation.setDuration(mCalendarControlsAnimationTime); ObjectAnimator.setFrameDelay(0); slideAnimation.start(); } else { mMiniMonth.setVisibility(View.GONE); mCalendarsList.setVisibility(View.GONE); mMiniMonthContainer.setVisibility(View.GONE); } } else { // show minimonth and calendar frag mShowSideViews = true; mMiniMonth.setVisibility(View.VISIBLE); mCalendarsList.setVisibility(View.VISIBLE); mMiniMonthContainer.setVisibility(View.VISIBLE); if (!mHideControls && (mController.getPreviousViewType() == ViewType.MONTH || mController.getPreviousViewType() == ViewType.AGENDA)) { final ObjectAnimator slideAnimation = ObjectAnimator.ofInt(this, "controlsOffset", animationSize, 0); slideAnimation.setDuration(mCalendarControlsAnimationTime); ObjectAnimator.setFrameDelay(0); slideAnimation.start(); } } } displayTime = event.selectedTime != null ? event.selectedTime.toMillis(true) : event.startTime.toMillis(true); if (!mIsTabletConfig) { mActionBarMenuSpinnerAdapter.setTime(displayTime); } } else if (event.eventType == EventType.VIEW_EVENT) { // If in Agenda view and "show_event_details_with_agenda" is "true", // do not create the event info fragment here, it will be created by the Agenda // fragment if (mCurrentView == ViewType.AGENDA && mShowEventDetailsWithAgenda) { if (event.startTime != null && event.endTime != null) { // Event is all day , adjust the goto time to local time if (event.isAllDay()) { Utils.convertAlldayUtcToLocal(event.startTime, event.startTime.toMillis(false), mTimeZone); Utils.convertAlldayUtcToLocal(event.endTime, event.endTime.toMillis(false), mTimeZone); } mController.sendEvent(this, EventType.GO_TO, event.startTime, event.endTime, event.selectedTime, event.id, ViewType.AGENDA, CalendarController.EXTRA_GOTO_TIME, null, null); } else if (event.selectedTime != null) { mController.sendEvent(this, EventType.GO_TO, event.selectedTime, event.selectedTime, event.id, ViewType.AGENDA); } } else { // TODO Fix the temp hack below: && mCurrentView != // ViewType.AGENDA if (event.selectedTime != null && mCurrentView != ViewType.AGENDA) { mController.sendEvent(this, EventType.GO_TO, event.selectedTime, event.selectedTime, -1, ViewType.CURRENT); } int response = event.getResponse(); if ((mCurrentView == ViewType.AGENDA && mShowEventInfoFullScreenAgenda) || ((mCurrentView == ViewType.DAY || (mCurrentView == ViewType.WEEK) || mCurrentView == ViewType.MONTH) && mShowEventInfoFullScreen)) { // start event info as activity Intent intent = new Intent(Intent.ACTION_VIEW); Uri eventUri = ContentUris.withAppendedId(Events.CONTENT_URI, event.id); intent.setData(eventUri); intent.setClass(this, EventInfoActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.putExtra(EXTRA_EVENT_BEGIN_TIME, event.startTime.toMillis(false)); intent.putExtra(EXTRA_EVENT_END_TIME, event.endTime.toMillis(false)); intent.putExtra(ATTENDEE_STATUS, response); startActivity(intent); } else { // start event info as a dialog EventInfoFragment fragment = new EventInfoFragment(this, event.id, event.startTime.toMillis(false), event.endTime.toMillis(false), response, true, EventInfoFragment.DIALOG_WINDOW_STYLE, null /* No reminders to explicitly pass in. */); fragment.setDialogParams(event.x, event.y, mActionBar.getHeight()); // FragmentManager fm = getFragmentManager(); FragmentManager fm = getSupportFragmentManager(); FragmentTransaction ft = fm.beginTransaction(); // if we have an old popup replace it Fragment fOld = fm.findFragmentByTag(EVENT_INFO_FRAGMENT_TAG); if (fOld != null && fOld.isAdded()) { ft.remove(fOld); } ft.add(fragment, EVENT_INFO_FRAGMENT_TAG); ft.commit(); } } displayTime = event.startTime.toMillis(true); } else if (event.eventType == EventType.UPDATE_TITLE) { setTitleInActionBar(event); if (!mIsTabletConfig) { mActionBarMenuSpinnerAdapter.setTime(mController.getTime()); } } updateSecondaryTitleFields(displayTime); }