Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5988405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:57:14+00:00 2026-05-22T22:57:14+00:00

I have set up intent filters to handle certain email links with my app.

  • 0

I have set up intent filters to handle certain email links with my app. This works well in Android’s basic mail program. I click the link, I am prompted whether to open it using the browser or my app, and after selecting my app it is handled correctly. The same is not true for using the Gmail app. How can I be sure to handle this app correctly as well? The intent filter seems to work – I am prompted for the browser or my app, however upon selecting my app, it is forced to close. Here is the error from my logcat:

06-02 01:23:11.337: ERROR/AndroidRuntime(11145): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android/com.example.android.Example}: java.lang.NullPointerException
06-02 01:23:11.337: ERROR/AndroidRuntime(11145):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
06-02 01:23:11.337: ERROR/AndroidRuntime(11145):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
06-02 01:23:11.337: ERROR/AndroidRuntime(11145):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
06-02 01:23:11.337: ERROR/AndroidRuntime(11145):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
06-02 01:23:11.337: ERROR/AndroidRuntime(11145):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-02 01:23:11.337: ERROR/AndroidRuntime(11145):     at android.os.Looper.loop(Looper.java:123)
06-02 01:23:11.337: ERROR/AndroidRuntime(11145):     at android.app.ActivityThread.main(ActivityThread.java:4627)
06-02 01:23:11.337: ERROR/AndroidRuntime(11145):     at java.lang.reflect.Method.invokeNative(Native Method)
06-02 01:23:11.337: ERROR/AndroidRuntime(11145):     at java.lang.reflect.Method.invoke(Method.java:521)
06-02 01:23:11.337: ERROR/AndroidRuntime(11145):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
06-02 01:23:11.337: ERROR/AndroidRuntime(11145):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-02 01:23:11.337: ERROR/AndroidRuntime(11145):     at dalvik.system.NativeStart.main(Native Method)
06-02 01:23:11.337: ERROR/AndroidRuntime(11145): Caused by: java.lang.NullPointerException
06-02 01:23:11.337: ERROR/AndroidRuntime(11145):     at com.example.android.Example.onCreate(Example.java:301)
06-02 01:23:11.337: ERROR/AndroidRuntime(11145):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
06-02 01:23:11.337: ERROR/AndroidRuntime(11145):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
06-02 01:23:11.337: ERROR/AndroidRuntime(11145):     ... 11 more

Also, here is my code for handling the incoming intent in onCreate:

if (getIntent().getCategories().contains("android.intent.category.BROWSABLE")){
     try{
        Uri uri = getIntent().getData();
        String url = uri.getFragment();
        //parse url and handle its contents
     }catch(Exception e){
        Toast.makeText(this, "could not open url", Toast.LENGTH_LONG).show();
     }
  }

Any help would be much appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T22:57:15+00:00Added an answer on May 22, 2026 at 10:57 pm

    getIntent().getCategories() will return null if there are no categories. To fix the problem, I changed this if statement to:

    if (getIntent().getAction().equals("android.intent.action.VIEW")){...}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app with four activities. I have set the intent-filter on one
I have got Eclipse to generate a Basic android Hello World app, But it
I have set up an app that is registered for remote notifications. - (void)application:(UIApplication*)application
I have an application that contains two Activities with <intent-filter> <action android:name=android.intent.action.MAIN/> <category android:name=android.intent.category.LAUNCHER/>
I just set up eclipse to start android development according to this http://developer.android.com/sdk/installing.html .
I have an Android library project and the main application that uses this library
My app needs to have a intent-filter that responds to a Intent that has
I have a receiver that start after phone boot like this: <receiver android:name=.OnBootReceiver >
I am making an android app that has 2 widgets. I have 1 widget
In my Android app, I have a main activity that serves as an entry

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.