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:org.lytsing.android.weibo.ui.WebViewDialog.java

public static Intent getIntent(Context context, int title, String url) {
    return new Intent(context, WebViewDialog.class).putExtra(Intent.EXTRA_TITLE, title)
            .putExtra(Intent.EXTRA_STREAM, url);
}

From source file:Main.java

public static void ShareApplication(Context mContext) {
    Intent intent = new Intent(android.content.Intent.ACTION_SEND);
    intent.setType("text/plain");
    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
    intent.putExtra(Intent.EXTRA_SUBJECT, "Search Sri Lanka Railway Time Table");
    intent.putExtra(Intent.EXTRA_TITLE, "Search Sri Lanka Railway Time Table");
    intent.putExtra(Intent.EXTRA_TEXT,/*from w  w  w. j  av  a2  s.  c  om*/
            "Search \"Sri Lanka Railway Time Table\" on your Android. http://market.android.com/details?id=com.aselalee.trainschedule");
    mContext.startActivity(Intent.createChooser(intent, "Spread the word"));
    return;
}

From source file:com.googlecode.eyesfree.brailleback.WebViewDialog.java

public static Intent getIntent(Context context, int titleResId, String url) {
    Intent intent = new Intent(context, WebViewDialog.class);
    intent.putExtra(Intent.EXTRA_TITLE, titleResId);
    intent.putExtra(Intent.EXTRA_STREAM, url);
    return intent;
}

From source file:Main.java

/**
 * Intent chooser is customized to remove unwanted apps.
 * 1. FaceBook has bug where only links can be shared.
 * 2. Cannot share this type of content via Google Docs and Skype.
 *//*from   w w w  . jav  a  2s.c  om*/
public static void ShareResult(Context mContext, String mResult, String mTitle) {
    List<Intent> targetedShareIntents = new ArrayList<Intent>();
    Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
    shareIntent.setType("text/plain");
    List<ResolveInfo> resInfo = mContext.getPackageManager().queryIntentActivities(shareIntent, 0);
    if (!resInfo.isEmpty()) {
        for (ResolveInfo resolveInfo : resInfo) {
            String packageName = resolveInfo.activityInfo.packageName;
            Intent targetedShareIntent = new Intent(android.content.Intent.ACTION_SEND);
            targetedShareIntent.setType("text/plain");
            targetedShareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, mTitle);
            targetedShareIntent.putExtra(android.content.Intent.EXTRA_TITLE, mTitle);
            targetedShareIntent.putExtra(android.content.Intent.EXTRA_TEXT, mResult);
            if (!packageName.toLowerCase().contains("com.facebook.katana")
                    && !packageName.toLowerCase().contains("com.google.android.apps.docs")
                    && !packageName.toLowerCase().contains("com.skype.raider")) {
                targetedShareIntent.setPackage(packageName);
                targetedShareIntents.add(targetedShareIntent);
            }
        }
        Intent chooserIntent = Intent.createChooser(targetedShareIntents.remove(0), "Send your result");
        chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, targetedShareIntents.toArray(new Parcelable[] {}));
        mContext.startActivity(chooserIntent);
    }
    return;
}

From source file:org.lytsing.android.weibo.ui.WebViewDialog.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setTitle(getIntent().getIntExtra(Intent.EXTRA_TITLE, R.string.app_name));

    setContentView(R.layout.activity_licenses);

    WebView webView = (WebView) findViewById(R.id.content);
    webView.loadUrl(getIntent().getStringExtra(Intent.EXTRA_STREAM));
}

From source file:com.gdgdevfest.android.apps.devfestbcn.ui.phone.MapActivity.java

@Override
public void onSessionRoomSelected(String roomId, String roomTitle) {
    Intent roomIntent = new Intent(Intent.ACTION_VIEW, ScheduleContract.Rooms.buildSessionsDirUri(roomId));
    roomIntent.putExtra(Intent.EXTRA_TITLE, roomTitle);
    startActivity(roomIntent);// ww  w . j ava2s  .  com
}

From source file:com.kth.baasio.helpcenter.SimpleSinglePaneActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_singlepane_empty);

    if (getIntent().hasExtra(Intent.EXTRA_TITLE)) {
        setTitle(getIntent().getStringExtra(Intent.EXTRA_TITLE));
    }//  w w  w.j ava  2 s.  c  o  m

    final String customTitle = getIntent().getStringExtra(Intent.EXTRA_TITLE);
    setTitle(customTitle != null ? customTitle : getTitle());

    if (savedInstanceState == null) {
        mFragment = onCreatePane();
        mFragment.setArguments(intentToFragmentArguments(getIntent()));
        getSupportFragmentManager().beginTransaction().add(R.id.root_container, mFragment, "single_pane")
                .commit();
    } else {
        mFragment = (Fragment) getSupportFragmentManager().findFragmentByTag("single_pane");
    }
}

From source file:com.WazaBe.GooglePlusStream.SimpleSinglePaneActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_singlepane_empty);

    if (getIntent().hasExtra(Intent.EXTRA_TITLE)) {
        setTitle(getIntent().getStringExtra(Intent.EXTRA_TITLE));
    }//from   ww w  .ja  va 2s .  com

    final String customTitle = getIntent().getStringExtra(Intent.EXTRA_TITLE);
    setTitle(customTitle != null ? customTitle : getTitle());

    if (savedInstanceState == null) {
        mFragment = onCreatePane();
        mFragment.setArguments(intentToFragmentArguments(getIntent()));
        getSupportFragmentManager().beginTransaction().add(R.id.root_container, mFragment, "single_pane")
                .commit();
    } else {
        mFragment = getSupportFragmentManager().findFragmentByTag("single_pane");
    }
}

From source file:com.conferenceengineer.android.iosched.ui.SimpleSinglePaneActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(getContentViewResId());

    if (getIntent().hasExtra(Intent.EXTRA_TITLE)) {
        setTitle(getIntent().getStringExtra(Intent.EXTRA_TITLE));
    }/*  ww  w  .j a v  a 2s.  c o  m*/

    final String customTitle = getIntent().getStringExtra(Intent.EXTRA_TITLE);
    setTitle(customTitle != null ? customTitle : getTitle());

    if (savedInstanceState == null) {
        mFragment = onCreatePane();
        mFragment.setArguments(intentToFragmentArguments(getIntent()));
        getSupportFragmentManager().beginTransaction().add(R.id.root_container, mFragment, "single_pane")
                .commit();
    } else {
        mFragment = getSupportFragmentManager().findFragmentByTag("single_pane");
    }
}

From source file:com.andrada.sitracker.ui.SimpleSinglePaneActivity.java

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(getContentViewResId());

    if (getIntent().hasExtra(Intent.EXTRA_TITLE)) {
        setTitle(getIntent().getStringExtra(Intent.EXTRA_TITLE));
    }/*  w w  w .j av  a  2  s.  c o m*/

    final String customTitle = getIntent().getStringExtra(Intent.EXTRA_TITLE);
    setTitle(customTitle != null ? customTitle : getTitle());

    if (savedInstanceState == null) {
        mFragment = onCreatePane();
        mFragment.setArguments(intentToFragmentArguments(getIntent()));
        getSupportFragmentManager().beginTransaction().add(R.id.root_container, mFragment, "single_pane")
                .commit();
    } else {
        mFragment = getSupportFragmentManager().findFragmentByTag("single_pane");
    }
}