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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:20:05+00:00 2026-06-05T00:20:05+00:00

I can statically register my activity to handle startActivity() by adding <intent-filter> in the

  • 0

I can statically register my activity to handle startActivity() by adding <intent-filter> in the manifest file. But how can I register it dynamically when my activity is running? For example, how can I register it after a button is clicked?

My application requires the user to specify a URL, and then I want to handle browsing requests to this URL. So I can only obtain this URL at run time. I looked at registerReceiver() only to find that it is only useful for sendBroadcast(), and not for startActivity().

In fact, I’m doing OAuth authentication with the server, and I want to return to my activity after OAuth. So I want to handle the <server-api-path>/auth/displaycode path.

I know that I can use a custom URL scheme and handle it statically in the manifest file, but according to 1, this is not a good practice.

After searching in the documents for an afternoon, I still can’t figure this out. Any help is 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-06-05T00:20:07+00:00Added an answer on June 5, 2026 at 12:20 am

    There is no API to dynamically register new Activity elements or modify the contents of the AndroidManifest at runtime. The best option for receiving an OAuth callback would be to implement a single Activity that contains a WebView, rather than launching the Browser or some external application and trying to return.

    With WebView you can monitor the URL traffic by attaching a WebViewClient, and using its methods like onPageStarted() and shouldOverrideUrlLoading() to determine when to jump back to the previous Activity or do some other action. Since you are doing all of this in code, the URL that you look for can be dynamic, even being passed in as an Intent extra to the Activity with the WebView

    HTH

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

Sidebar

Related Questions

Many statically typed languages have parametric polymorphism. For example in C# one can define:
I know I can set the height attribute statically in the stylesheet, but that's
Possible Duplicate: How can I tell if an object is statically or dynamically allocated
I know that functions can be called dynamically, but is there a way to
I link with Qt statically, so can linker or some other tool avoid adding
Can anyone tell me why ActionScript 3, a statically typed language, doesn't have generics?
In C++, I can statically initialize an array, e.g.: int a[] = { 1,
I've download gdb-6.5.bz2.tar. Untar this file. I write: LDFLAGS=-static ./configure but as a result
Is there any way I can check if a method is being called statically
I'm using a certain lib (libeay32). How can I statically build it into my

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.