Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 16802f0d authored by Alan Viverette's avatar Alan Viverette Committed by Android Git Automerger
Browse files

am 46c95313: am ddb30cd3: am 7506f499: Merge "Fix to crash when clicking text...

am 46c95313: am ddb30cd3: am 7506f499: Merge "Fix to crash when clicking text link without view activity"

* commit '46c95313':
  Fix to crash when clicking text link without view activity
parents aa99a1c4 46c95313
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.text.style;

import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
@@ -23,6 +24,7 @@ import android.os.Parcel;
import android.provider.Browser;
import android.text.ParcelableSpan;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;

public class URLSpan extends ClickableSpan implements ParcelableSpan {
@@ -59,6 +61,10 @@ public class URLSpan extends ClickableSpan implements ParcelableSpan {
        Context context = widget.getContext();
        Intent intent = new Intent(Intent.ACTION_VIEW, uri);
        intent.putExtra(Browser.EXTRA_APPLICATION_ID, context.getPackageName());
        try {
            context.startActivity(intent);
        } catch (ActivityNotFoundException e) {
            Log.w("URLSpan", "Actvity was not found for intent, " + intent.toString());
        }
    }
}