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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:10:55+00:00 2026-06-14T11:10:55+00:00

I have a android app, in which the main activity calls a function from

  • 0

I have a android app, in which the main activity calls a function from a external library, which then opens a webview if neccesary.

Opening the webview is no problem. My problem start when people/users close the webview. It appears that the webview (I think, I am not sure though) has opened an extra activity or something on top of the original app that called the external library.

Now users have to close 2 windows, before they can continue in the original app.

Does anyone have experience with this, or knows what’s happening here?

MainActivity

public class MainActivity extends Activity
{
    private final String appKey = "Android.Lib.Test";

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        externalLib.Initialize(this, getIntent(), appKey);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu)
    {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
}

External Lib

public class externalLib
{
    private static final String TAG = "externalLib";
    private static int messageId;

    public static void Initialize(Context context, Intent intent, String newAppKey)
    {
        Log.d(TAG, "initializing");

        APPKEY = newAppKey;

        if(intent.hasExtra("url"))
        {
            if(intent.getExtras().getString("url") != null)
            {
                Intent webViewIntent = new Intent(context, externalLibWebView.class);
                webViewIntent.putExtra("url", intent.getExtras().getString("url"));
                context.startActivity(webViewIntent);
            }
        }

        if(intent.hasExtra("messageId"))
        {
            messageId = intent.getExtras().getInt("messageId");
            Log.e(TAG, "messageId: " + messageId);
        }
        else
        {
            messageId = 0;
        }
    }    
}
  • 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-14T11:10:56+00:00Added an answer on June 14, 2026 at 11:10 am

    I found out what the problems was. I wanted the webview to load the url, but instead, the browser was opened leaving the webview empty and thus “creating” the extra acitvity. Now the webview loads the url.

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

Sidebar

Related Questions

I have an Android app which includes an activity called Help This uses a
I am developing an android app in which I have included a library project,
I'm writing an Android app. I have a main method, which creates and runs
In my Android application I have a main activity MyActivity which overrides onConfigurationChanged() method.
I have an android app, I'm moving to fragment based design. The main activity
I have an app which is basically a launcher with a main activity and
In my Android app, I have a main activity that serves as an entry
I have an android app which has native code. The native code needs to
I have an android app which let the user to submit a form ,
I have an Android app which is crashing on some phones, and not on

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.