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

  • Home
  • SEARCH
  • 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 7459077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T13:57:11+00:00 2026-05-29T13:57:11+00:00

I have developed a very simple Android native app to launch my HTML5 webapp.

  • 0

I have developed a very simple Android native app to launch my HTML5 webapp.
Here is the main class:

package com.plancake.android.app;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;

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

        Intent viewIntent = new Intent("android.intent.action.VIEW", Uri.parse("https://www.mywebsite.com"));  
        startActivity(viewIntent);   
    }
}

When I tap its icon from my homescreen the first time everything works fine: Android opens up the browser and my webapp is loaded. Lovely!

The problem arises when I leave the webbrowser and I tap again on my launcher icon from the home screen or task manager. In that case, I get just a black screen.

I think the problem is that Android calls the onResume method (or something else), anyway not the onCreate in this latter case.

I can see two solutions:
1) Either I replicate the startActivity call in all other methods, such as onStart, onRestore – but in that case I am afraid my app will create a new browser window everytime, therefore consuming a lot of memory unnecessarily
2) Or after each tap, force my launcher app to leave the memory so that the onCreate method is called everytime I tap – but in this case, even if I “kill” my app, the browser will be still open so next time I tap on my launcher icon a new browser window will be created anyway

I hope I was clear enough in describing my problem and the solutions I thought of – which either of them are ideal.

Please, I would like to know how you would suggest to solve my problem.

Thanks,
Dan

  • 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-29T13:57:13+00:00Added an answer on May 29, 2026 at 1:57 pm

    The onResume() method is always called after onCreate().

    If you leave your activity and it is not killed by the system, then it might not be “created” again. It is left in a paused state.

    What you should do is move your code to onResume() to ensure that the intent creating the webview is called every single time you enter your application

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

Sidebar

Related Questions

Recently, I have a developed a very simple web app for a survey. I
I have developed a very simple app that uses a custom adapter for a
I have a very simple windows Service that is developed in vb.net 2008. When
I have developed a simple location aware iPhone application which is functionally working very
I have developed a very simple C++ based cocoa touch static library and a
i have developed a simple AsyncTask class that takes Handlers as its parameters and
I need to develop a very simple class developed as a Windows Script Component
I was given an assignment to develop a very simple weather app in Android
I have developed some custom DAO-like classes to meet some very specialized requirements for
I have developed an AJAX based game where there is a bug caused (very

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.