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 980131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:19:51+00:00 2026-05-16T04:19:51+00:00

I’m a novice Android programmer, and to help me understand how Intents really work,

  • 0

I’m a novice Android programmer, and to help me understand how Intents really work, I wanted to put together a small Activity which would let the user call startActivity() with any action and data they want. I tried many different combinations, including “android.intent.action.VIEW” and “http://www.google.com“. No matter what combinations I use, I always get an ActivityNotFoundException. Any ideas as to why?

The code in my only Activity is below:

public class TestingIntents extends Activity 
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Button goButton = (Button) findViewById(R.id.button);

        goButton.setOnClickListener(new ClickListener());
    }

    private class ClickListener implements OnClickListener
    {
        @Override
        public void onClick(View arg0) 
        {
            String id = ((EditText) findViewById(R.id.intent)).getText().toString();
            String data = ((EditText) findViewById(R.id.data)).getText().toString();

            Builder builder = new Builder();
            builder = builder.path(data);

            Uri path = builder.build();

            Intent i = new Intent(id, path);
            startActivity(i);
        }
    }
}

The results of adb shell logcat from the time of starting the app to just after touching ‘Force close’ are below.

I/ActivityManager( 1086):
 Starting activity: Intent { act=android.intent.action.
MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=tk.h2g2guy.testin
gIntents/.TestingIntents }
I/ActivityManager( 1086): Start proc tk.h2g2guy.testingIntents for activity tk.h
2g2guy.testingIntents/.TestingIntents: pid=4037 uid=10054 gids={}
D/dalvikvm( 1006): GC_EXPLICIT freed 289 objects / 10960 bytes in 98ms
D/dalvikvm( 1006): GC_EXPLICIT freed 47 objects / 2088 bytes in 121ms
D/dalvikvm( 1006): GC_EXPLICIT freed 2 objects / 48 bytes in 109ms
I/ActivityManager( 1086): Displayed activity tk.h2g2guy.testingIntents/.TestingI
ntents: 462 ms (total 462 ms)
D/dalvikvm( 2300): GC_EXPLICIT freed 1226 objects / 61640 bytes in 69ms
I/ActivityManager( 1086): Starting activity: Intent { act=android.intent.action.
VIEW dat=http%3A//www.google.com }
D/AndroidRuntime( 4037): Shutting down VM
W/dalvikvm( 4037): threadid=1: thread exiting with uncaught exception (group=0x4
001d7e0)
E/AndroidRuntime( 4037): FATAL EXCEPTION: main
E/AndroidRuntime( 4037): android.content.ActivityNotFoundException: No Activity
found to handle Intent { act=android.intent.action.VIEW dat=http%3A//www.google.
com }
E/AndroidRuntime( 4037):        at android.app.Instrumentation.checkStartActivit
yResult(Instrumentation.java:1408)
E/AndroidRuntime( 4037):        at android.app.Instrumentation.execStartActivity
(Instrumentation.java:1378)
E/AndroidRuntime( 4037):        at android.app.Activity.startActivityForResult(A
ctivity.java:2817)
E/AndroidRuntime( 4037):        at android.app.Activity.startActivity(Activity.j
ava:2923)
E/AndroidRuntime( 4037):        at tk.h2g2guy.testingIntents.TestingIntents$Clic
kListener.onClick(TestingIntents.java:41)
E/AndroidRuntime( 4037):        at android.view.View.performClick(View.java:2408
)
E/AndroidRuntime( 4037):        at android.view.View$PerformClick.run(View.java:
8816)
E/AndroidRuntime( 4037):        at android.os.Handler.handleCallback(Handler.jav
a:587)
E/AndroidRuntime( 4037):        at android.os.Handler.dispatchMessage(Handler.ja
va:92)
E/AndroidRuntime( 4037):        at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 4037):        at android.app.ActivityThread.main(ActivityThrea
d.java:4627)
E/AndroidRuntime( 4037):        at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime( 4037):        at java.lang.reflect.Method.invoke(Method.java:5
21)
E/AndroidRuntime( 4037):        at com.android.internal.os.ZygoteInit$MethodAndA
rgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime( 4037):        at com.android.internal.os.ZygoteInit.main(Zygot
eInit.java:626)
E/AndroidRuntime( 4037):        at dalvik.system.NativeStart.main(Native Method)

W/ActivityManager( 1086):   Force finishing activity tk.h2g2guy.testingIntents/.
TestingIntents
W/ActivityManager( 1086): Activity pause timeout for HistoryRecord{449d4518 tk.h
2g2guy.testingIntents/.TestingIntents}
I/Process ( 4037): Sending signal. PID: 4037 SIG: 9
I/ActivityManager( 1086): Process tk.h2g2guy.testingIntents (pid 4037) has died.

I/WindowManager( 1086): WIN DEATH: Window{44bd4120 tk.h2g2guy.testingIntents/tk.
h2g2guy.testingIntents.TestingIntents paused=false}
  • 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-16T04:19:52+00:00Added an answer on May 16, 2026 at 4:19 am

    I tried many different combinations,
    including
    “android.intents.action.VIEW” and
    “html://www.google.com”.

    android.intents.action.VIEW is not a valid activity action. You probably want to drop the s.

    html://www.google.com is not a valid URL. You probably want to replace the html:// with http://.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

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.