Start Google Hangout from Intent in New Hangouts Android app-ThrowExceptions

Exception or error:

There are previous discussions here regarding starting a Google Hangout from an intent on Android:
start google hangouts in android

How can I start a Google Hangout in Android with an Intent?

The conclusion was that this was not possible. It is a requested enhancement here:

However, yesterday Google released a new Hangouts app, with a new set of intents. Is starting a hangout via intent now possible?

I have been partially successful with action=android.intent.action.VIEW, data=content://

However, I want to pass the name or ID of the person I want to call–the recipient name. I can’t figure this out.

The new browser-based hangout app starts a hangout with a URL something like this:[26-character ID]?hl=en_US&hscid=[19-digit ID]&hpe=[14-character value]&hpn=[Google+ Name of Recipient]&hnc=0&hs=41.

I assume that not all of these parameters are necessary to start a hangout, but I cannot decipher how to pass the recipient name in the intent.

Any thoughts?
Thank you.

How to solve:

So I don’t know if this helps anyone else because I was mostly looking to fire off an intent using tasker. If you go into Google+ > Settings > Contacts you can check “Keep contacts up to date” and it will add some new actions to card that appears when you click on a user in android. Then you can use Intent Intercept to read the values coming through. Here’s what I got:

ACTION: android.intent.action.VIEW
DATA: content://


Hangouts ( -

I was able to use the top three values to properly open a conversation with that contact. Obviously the number in your data field will change depending on the contact. You can either use the trick with Intent Intercept, or if you have root you can use something like SQLite Debugger to crack open the data table in the contacts database and find rows where the MIMETYPE_ID = 16 and the DATA4 = 10. You’ll have to find your out what your RAW_CONTACT_ID is too. Good luck!


Simple solution is, Query ContactContract.Data for the _id and MIME type.

ContentResolver resolver = context.getContentResolver();  
cursor = resolver.query(
            null, null, null,

//Now read data from cursor like 

while (cursor.moveToNext()) {
      long _id = cursor.getLong(cursor.getColumnIndex(ContactsContract.Data._ID));
      String displayName = cursor.getString(cursor.getColumnIndex(ContactsContract.Data.DISPLAY_NAME));
      String mimeType = cursor.getString(cursor.getColumnIndex(ContactsContract.Data.MIMETYPE));

      Log.d("Data", _id+ " "+ displayName + " " + mimeType );


The output will be like the following

12561 Allen

12562 Allen

12564 Allen

Now save in DB or somewhere else only those _Ids whose MIME type is

And then you initiate hangout call/message with those contacts like this way

Intent intent = new Intent();

// the _ids you save goes here at the end of /data/12562     


For the above code to work you must have to check “Keep contacts up to date” in the Google+ App > Settings> Contacts.


Hangout can handle generic share intent.

Here is the code:

        Intent sendIntent = new Intent(Intent.ACTION_SEND);
        sendIntent.putExtra(Intent.EXTRA_TEXT, "text to be shared");



try in this way

Below method use to share text to hangout

 * Initiate the actions encoded in the specified URI.
public void initiateHangOutUri(Context myContext, String textToShare) {

  // Make sure Android client is installed.
  if (!isHangOutClientInstalled(myContext)) {

  Intent sendIntent = new Intent();
  sendIntent.putExtra(Intent.EXTRA_TEXT, textToShare);


Below method use to check HangOut installed on this device

 * Determine whether the HangOut for Android client is installed on this device.
public boolean isHangOutClientInstalled(Context myContext) {
  final PackageManager packageManager = context.getPackageManager();
    Intent intent = packageManager.getLaunchIntentForPackage("");
    if (intent == null) {
        return false;
    List<ResolveInfo> list = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
    return list.size() > 0;

Below method use goto playstore if HangOut not installed

public void goToMarket(Context myContext) {
  Uri marketUri = Uri.parse("market://details?");
  Intent myIntent = new Intent(Intent.ACTION_VIEW, marketUri);



hey i think you try this.

Intent sky = new Intent("android.intent.action.VIEW", Uri.parse(""));

You just need to give the url of the hangout, but unfortunately google suspended the named hangots, so this url every time changes.

Leave a Reply

Your email address will not be published. Required fields are marked *