Example usage for android.content Intent EXTRA_TITLE

List of usage examples for android.content Intent EXTRA_TITLE

Introduction

In this page you can find the example usage for android.content Intent EXTRA_TITLE.

Prototype

String EXTRA_TITLE

To view the source code for android.content Intent EXTRA_TITLE.

Click Source Link

Document

A CharSequence dialog title to provide to the user when used with a #ACTION_CHOOSER .

Usage

From source file:net.peterkuterna.android.apps.devoxxsched.ui.SessionScheduleItemsFragment.java

/** {@inheritDoc} */
public void onClick(View view) {
    if (view instanceof ScheduleItemView) {
        final ScheduleItemView itemView = (ScheduleItemView) view;
        final ScheduleItem item = itemView.getScheduleItem();
        final String title = itemView.getText().toString();
        AnalyticsUtils.getInstance(getActivity()).trackEvent("Schedule", "Session Click", title, 0);
        final String sessionId = item.getId();
        final Uri sessionsUri = CfpContract.Sessions.buildSessionUri(sessionId);
        final Intent intent = new Intent(Intent.ACTION_VIEW, sessionsUri);
        intent.putExtra(Intent.EXTRA_TITLE, title);
        ((BaseActivity) getSupportActivity()).openActivityOrFragment(intent);
    }//from  www.j  av  a 2 s.co  m
}

From source file:net.peterkuterna.android.apps.devoxxfrsched.ui.SessionScheduleItemsFragment.java

/** {@inheritDoc} */
public void onClick(View view) {
    if (view instanceof ScheduleItemView) {
        final ScheduleItemView itemView = (ScheduleItemView) view;
        final ScheduleItem item = itemView.getScheduleItem();
        final String title = itemView.getText().toString();
        AnalyticsUtils.getInstance(getActivity()).trackEvent("Schedule", "Session Click", title, 0);
        final String sessionId = item.getId();
        final Uri sessionsUri = CfpContract.Sessions.buildSessionUri(sessionId);
        final Intent intent = new Intent(Intent.ACTION_VIEW, sessionsUri);
        intent.putExtra(Intent.EXTRA_TITLE, title);
        ((BaseActivity) getActivity()).openActivityOrFragment(intent);
    }//from w  w  w. j a v  a  2  s  .c om
}

From source file:net.naonedbus.card.impl.CommentairesCard.java

@Override
protected Intent getMoreIntent() {
    final ParamIntent intent = new ParamIntent(getContext(), CommentaireActivity.class);
    intent.putExtra(CommentaireActivity.PARAM_LIGNE, mLigne);
    intent.putExtra(CommentaireActivity.PARAM_SENS, mSens);
    intent.putExtra(CommentaireActivity.PARAM_ARRET, mArret);

    intent.putExtra(Intent.EXTRA_TITLE, R.string.card_more_commenter);
    intent.putExtra(Intent.EXTRA_SHORTCUT_ICON, R.drawable.ic_card_send);
    return intent;
}

From source file:com.google.android.apps.iosched2.ui.WhatsOnFragment.java

private void setupDuring() {
    // Conference in progress, show "Now Playing" link.
    View view = getActivity().getLayoutInflater().inflate(R.layout.whats_on_now_playing, mRootView, false);
    view.setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            if (UIUtils.isHoneycombTablet(getActivity())) {
                //startActivity(new Intent(getActivity(), NowPlayingMultiPaneActivity.class));
                startActivity(new Intent(getActivity(), Setup.NowPlayingMultiPaneActivityClass));

            } else {
                Intent intent = new Intent(Intent.ACTION_VIEW);
                intent.setData(ScheduleContract.Sessions.buildSessionsAtDirUri(System.currentTimeMillis()));
                intent.putExtra(Intent.EXTRA_TITLE, getString(R.string.title_now_playing));
                startActivity(intent);//from   w ww .j a  v  a 2  s. c  o m
            }
        }
    });
    mRootView.addView(view);
}

From source file:com.google.android.apps.iosched.ui.WhatsOnFragment.java

private void setupDuring() {
    // Conference in progress, show "Now Playing" link.
    View view = getActivity().getLayoutInflater().inflate(R.layout.whats_on_now_playing, mRootView, false);
    view.setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            if (UIUtils.isHoneycombTablet(getActivity())) {
                startActivity(new Intent(getActivity(), NowPlayingMultiPaneActivity.class));
            } else {
                Intent intent = new Intent(Intent.ACTION_VIEW);
                intent.setData(ScheduleContract.Sessions.buildSessionsAtDirUri(System.currentTimeMillis()));
                intent.putExtra(Intent.EXTRA_TITLE, getString(R.string.title_now_playing));
                startActivity(intent);//from w w  w.  j  a v a 2  s  . c o m
            }
        }
    });
    mRootView.addView(view);
}

From source file:com.google.android.apps.iosched.ui.tablet.SessionsVendorsMultiPaneActivity.java

private void routeIntent(Intent intent, boolean updateSurfaceOnly) {
    Uri uri = intent.getData();//from  ww  w  .  ja  va  2 s . c om
    if (uri == null) {
        return;
    }

    if (intent.hasExtra(Intent.EXTRA_TITLE)) {
        setTitle(intent.getStringExtra(Intent.EXTRA_TITLE));
    }

    String mimeType = getContentResolver().getType(uri);

    if (ScheduleContract.Tracks.CONTENT_ITEM_TYPE.equals(mimeType)) {
        // Load track details
        showFullUI(true);
        if (!updateSurfaceOnly) {
            // TODO: don't assume the URI will contain the track ID
            String selectedTrackId = ScheduleContract.Tracks.getTrackId(uri);
            loadTrackList(TracksDropdownFragment.VIEW_TYPE_SESSIONS, selectedTrackId);
            onTrackSelected(selectedTrackId);
            if (mShowHideMasterLayout != null) {
                mShowHideMasterLayout.showMaster(true, ShowHideMasterLayout.FLAG_IMMEDIATE);
            }
        }

    } else if (ScheduleContract.Sessions.CONTENT_TYPE.equals(mimeType)) {
        // Load a session list, hiding the tracks dropdown and the tabs
        mViewType = TracksDropdownFragment.VIEW_TYPE_SESSIONS;
        showFullUI(false);
        if (!updateSurfaceOnly) {
            loadSessionList(uri, null);
            if (mShowHideMasterLayout != null) {
                mShowHideMasterLayout.showMaster(true, ShowHideMasterLayout.FLAG_IMMEDIATE);
            }
        }

    } else if (ScheduleContract.Sessions.CONTENT_ITEM_TYPE.equals(mimeType)) {
        // Load session details
        if (intent.hasExtra(EXTRA_MASTER_URI)) {
            mViewType = TracksDropdownFragment.VIEW_TYPE_SESSIONS;
            showFullUI(false);
            if (!updateSurfaceOnly) {
                loadSessionList((Uri) intent.getParcelableExtra(EXTRA_MASTER_URI),
                        ScheduleContract.Sessions.getSessionId(uri));
                loadSessionDetail(uri);
            }
        } else {
            mViewType = TracksDropdownFragment.VIEW_TYPE_SESSIONS; // prepare for onTrackInfo...
            showFullUI(true);
            if (!updateSurfaceOnly) {
                loadSessionDetail(uri);
                loadTrackInfoFromSessionUri(uri);
            }
        }

    } else if (ScheduleContract.Vendors.CONTENT_TYPE.equals(mimeType)) {
        // Load a vendor list
        mViewType = TracksDropdownFragment.VIEW_TYPE_VENDORS;
        showFullUI(false);
        if (!updateSurfaceOnly) {
            loadVendorList(uri, null);
            if (mShowHideMasterLayout != null) {
                mShowHideMasterLayout.showMaster(true, ShowHideMasterLayout.FLAG_IMMEDIATE);
            }
        }

    } else if (ScheduleContract.Vendors.CONTENT_ITEM_TYPE.equals(mimeType)) {
        // Load vendor details
        mViewType = TracksDropdownFragment.VIEW_TYPE_VENDORS;
        showFullUI(false);
        if (!updateSurfaceOnly) {
            Uri masterUri = (Uri) intent.getParcelableExtra(EXTRA_MASTER_URI);
            if (masterUri == null) {
                masterUri = ScheduleContract.Vendors.CONTENT_URI;
            }
            loadVendorList(masterUri, ScheduleContract.Vendors.getVendorId(uri));
            loadVendorDetail(uri);
        }
    }

    updateDetailBackground();
}

From source file:tw.idv.gasolin.pycontw2012.ui.WhatsOnFragment.java

private void setupDuring() {
    // Conference in progress, show "Now Playing" link.
    View view = getActivity().getLayoutInflater().inflate(R.layout.whats_on_now_playing, mRootView, false);
    view.setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            if (UIUtils.isHoneycombTablet(getActivity())) {
                startActivity(new Intent(getActivity(), NowPlayingMultiPaneActivity.class));
            } else {
                Intent intent = new Intent(Intent.ACTION_VIEW);
                intent.setData(CoscupContract.Sessions.buildSessionsAtDirUri(System.currentTimeMillis()));
                intent.putExtra(Intent.EXTRA_TITLE, getString(R.string.title_now_playing));
                startActivity(intent);/*from  w w  w .j  a  v  a2 s.com*/
            }
        }
    });
    mRootView.addView(view);
}

From source file:org.tunesremote.PlaylistsFragment.java

@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
    try {//from w w w  .  j a va 2s .  c  o m
        final Playlist ply = (Playlist) adapter.getItem(position);
        final String playlistid = Long.toString(ply.getID());

        Intent intent = new Intent(host, TracksActivity.class);
        intent.putExtra(Intent.EXTRA_TITLE, "");
        intent.putExtra("Playlist", playlistid);
        intent.putExtra("PlaylistPersistentId", ply.getPersistentId());
        intent.putExtra("AllAlbums", false);
        host.startActivityForResult(intent, 1);

    } catch (Exception e) {
        Log.w(TAG, "onCreate:" + e.getMessage());
    }
}

From source file:com.money.manager.ex.core.file.TextFileExport.java

private void offerFile(Uri fileUri, String title) {
    Intent intent = new Intent();
    intent.setAction(Intent.ACTION_SEND);
    intent.setType("text/plain");
    intent.putExtra(Intent.EXTRA_TITLE, title);
    intent.putExtra(Intent.EXTRA_STREAM, fileUri);

    Intent chooser = Intent.createChooser(intent, title);
    getContext().startActivity(chooser);
}

From source file:com.uphyca.kitkat.storage.ui.MainFragment.java

/**
 * ??/*from  ww w. j av a2  s. c  om*/
 */
@OnClick(R.id.button_create)
void onCreateButtonClick() {
    String fileName = String.format("document-%d.txt", new SecureRandom().nextInt());
    Intent intent = new Intent().setAction(Intent.ACTION_CREATE_DOCUMENT).addCategory(Intent.CATEGORY_OPENABLE)
            .setType("text/plain").putExtra(Intent.EXTRA_TITLE, fileName);
    startActivityForResult(intent, REQUEST_CREATE);
}