List of usage examples for android.content Intent FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET
int FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET
To view the source code for android.content Intent FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET.
Click Source Link
From source file:com.wifi.brainbreaker.mydemo.spydroid.ui.AboutFragment.java
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.about, container, false); mButtonVisit = (Button) rootView.findViewById(R.id.visit); mButtonRate = (Button) rootView.findViewById(R.id.rate); mButtonLike = (Button) rootView.findViewById(R.id.like); mButtonVisit.setOnClickListener(new OnClickListener() { @Override/*from w w w .j a va 2 s.c o m*/ public void onClick(View v) { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://code.google.com/p/spydroid-ipcamera/")); intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); startActivity(intent); } }); mButtonRate.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { String appPackageName = SpydroidApplication.getInstance().getApplicationContext().getPackageName(); Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)); intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); startActivity(intent); } }); mButtonLike.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.facebook.com/spydroidipcamera")); intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); startActivity(intent); } }); return rootView; }
From source file:ca.rmen.android.networkmonitor.app.speedtest.SpeedTestAboutActivity.java
public void playStoreClicked(View view) { Log.v(TAG, "playStoreClicked"); String playStoreUrl = "https://play.google.com/store/search?c=apps&q=speed test"; final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(playStoreUrl)); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); startActivity(intent);/*from ww w . ja va 2s . co m*/ }
From source file:com.manning.androidhacks.hack023.BootstrapActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.bootstrap);/*from w w w .jav a 2 s . c o m*/ mAccountManager = AccountManager.get(this); Account[] accounts = mAccountManager.getAccountsByType(AuthenticatorActivity.PARAM_ACCOUNT_TYPE); if (accounts.length == 0) { // There are no androidHacks accounts! We need to create one. Log.d(TAG, "No accounts found. Starting login..."); final Intent intent = new Intent(this, AuthenticatorActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); startActivityForResult(intent, NEW_ACCOUNT); } else { // For now we assume that there's only one account. String password = mAccountManager.getPassword(accounts[0]); Log.d(TAG, "Using account with name " + accounts[0].name); if (password == null) { Log.d(TAG, "The password is empty, launching login"); final Intent intent = new Intent(this, AuthenticatorActivity.class); intent.putExtra(AuthenticatorActivity.PARAM_USER, accounts[0].name); startActivityForResult(intent, EXISTING_ACCOUNT); } else { Log.d(TAG, "User and password found, no need for manual login"); // The user is already logged in. Go ahead! startActivity(new Intent(this, MainActivity.class)); finish(); } } }
From source file:com.karljamoralin.sunshine.DetailActivity.java
private Intent createShareForecastIntent() { Intent intent = new Intent(Intent.ACTION_SEND); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); intent.setType("text/plain"); intent.putExtra(Intent.EXTRA_TEXT, mForecast + FORECAST_SHARE_HASHTAG); return intent; }
From source file:com.games.iris.sunshine.DetailActivity.java
private Intent getShareIntent() { Intent shareIntent = new Intent(Intent.ACTION_SEND); shareIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); shareIntent.setType("text/plain"); shareIntent.putExtra(Intent.EXTRA_TEXT, extraString + HASHTAG_APP); return shareIntent; }
From source file:com.avalon.share.ShareHelper.java
private static void internalShareFile(String text, String longText, File file) { // let the FileProvider generate an URI for this private file final Uri uri = FileProvider.getUriForFile(activity, activity.getPackageName() + ".fileprovider", file); String resultText = text + " " + "https://play.google.com/store/apps/details?id=" + activity.getPackageName(); if (_hashTag.length() != 0) resultText = resultText + " #" + _hashTag; // create an intent, so the user can choose which application he/she wants to use to share this file final Intent intent = ShareCompat.IntentBuilder.from(activity).setType("image/*") //.setSubject(this.getString(R.string.share_subject)) .setStream(uri).setText(resultText) //.setChooserTitle(R.string.share_title) .createChooserIntent().addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET) .addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); activity.startActivity(intent);/* www .j a va 2 s .c om*/ }
From source file:com.meiste.greg.ptw.tab.Schedule.java
@Override public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) { setRetainInstance(true);//from ww w. j a v a2s .co m final View v = inflater.inflate(R.layout.list, container, false); mSwipeRefreshWidget = (SwipeRefreshLayout) v.findViewById(R.id.swipe_refresh_widget); mSwipeRefreshWidget.setOnRefreshListener(this); mSwipeRefreshWidget.setColorSchemeResources(R.color.refresh1, R.color.refresh2, R.color.refresh3, R.color.refresh4); mSwipeRefreshWidget.setEnabled(BuildConfig.DEBUG); final ListView lv = (ListView) v.findViewById(R.id.content); mAdapter = new RaceItemAdapter(getActivity(), R.layout.schedule_row); lv.setAdapter(mAdapter); lv.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(final AdapterView<?> parent, final View v, final int pos, final long id) { Util.log("Starting activity for race " + id); final Intent intent = new Intent(getActivity(), RaceActivity.class); intent.putExtra(RaceActivity.INTENT_ID, (int) id); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); startActivity(intent); } }); if (mNeedScroll) { final Race race = Race.getNext(getActivity(), true, true); if (race != null) { // If possible set previous race so "recent" race is shown (if applicable) final int id = race.getId(); lv.setSelection(id > 0 ? id - 1 : id); } mNeedScroll = false; } final IntentFilter filter = new IntentFilter(PTW.INTENT_ACTION_SCHEDULE); getActivity().registerReceiver(mScheduleUpdateReceiver, filter); return v; }
From source file:ar.org.fsadosky.iptablesmanager.activity.MainActivity.java
private void goToGooglePlay() { Uri uri = Uri.parse("market://details?id=" + getPackageName()); Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri); // To count with Play market backstack, After pressing back button, // to taken back to our application, we need to add following flags to intent. goToMarket.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET | Intent.FLAG_ACTIVITY_MULTIPLE_TASK); try {/*from ww w .j a v a2 s . c o m*/ startActivity(goToMarket); } catch (ActivityNotFoundException e) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id=" + getPackageName()))); } }
From source file:net.networksaremadeofstring.rhybudd.ViewZenossEvent.java
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: { finish();/*from w w w. j a va2s .c om*/ return true; } case R.id.AddLog: { addMessageDialog = new Dialog(ViewZenossEvent.this); addMessageDialog.setContentView(R.layout.add_message); addMessageDialog.setTitle("Add Message to Event Log"); ((Button) addMessageDialog.findViewById(R.id.SaveButton)).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { AddLogMessage(((EditText) addMessageDialog.findViewById(R.id.LogMessage)).getText().toString()); addMessageDialog.dismiss(); } }); addMessageDialog.show(); return true; } case R.id.escalate: { Intent intent = new Intent(android.content.Intent.ACTION_SEND); intent.setType("text/plain"); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); // Add data to the intent, the receiving app will decide what to do with it. intent.putExtra(Intent.EXTRA_SUBJECT, "Escalation of Zenoss Event on " + getIntent().getStringExtra("Device")); String EventDetails = getIntent().getStringExtra("Summary") + "\r\r\n" + getIntent().getStringExtra("LastTime") + "\r\r\n" + "Count: " + getIntent().getIntExtra("Count", 0); intent.putExtra(Intent.EXTRA_TEXT, EventDetails); startActivity(Intent.createChooser(intent, "How would you like to escalate this event?")); } default: { return false; } } }
From source file:org.xbmc.kore.utils.Utils.java
/** * Open the IMDb app or web page for the given person name. *//* w w w . j ava 2s .c o m*/ public static void openImdbForPerson(Context context, String name) { if (context == null || TextUtils.isEmpty(name)) { return; } Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(String.format(IMDB_APP_PERSON_SEARCH_URI, name))); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); // try launching IMDb app if (!Utils.tryStartActivity(context, intent)) { // on failure, try launching the web page intent = new Intent(Intent.ACTION_VIEW, Uri.parse(String.format(IMDB_PERSON_SEARCH_URL, name))); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); context.startActivity(intent); } }