Code example for Intent

Methods: startActivitysetFlags

0
        if (twitterName != null) { 
            final OnPreferenceClickListener openTwitter = new OnPreferenceClickListener() {
                @Override 
                public boolean onPreferenceClick(Preference preference) { 
                    Uri twitterURL = Uri.parse("http://twitter.com/#!/" + twitterName); 
                    final Intent intent = new Intent(Intent.ACTION_VIEW, twitterURL); 
                    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); 
                    getContext().startActivity(intent); 
                    return true; 
                } 
            }; 
 
            // changed to clicking the preference to open twitter 
            // it was a hit or miss to click the twitter bird 
            this.setOnPreferenceClickListener(openTwitter); 
            UrlImageViewHelper.setUrlDrawable(this.photoView, 
                    getGravatarUrl(devEmail), 
                    R.drawable.ic_null, 
                    UrlImageViewHelper.CACHE_DURATION_ONE_WEEK); 
        } else { 
            twitterButton.setVisibility(View.INVISIBLE);