1

I am developing an android app using phonegap (cordova-2.1.0).

My MainActivity.java code is as following -

package com.app.myapp;

import android.os.Bundle;
import org.apache.cordova.*;

public class MainActivity extends DroidGap {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.loadUrl("file:///android_asset/www/index.html");
    }
}

Problem : Whenever I start the application, it shows MainActivity window first and then show the actual HTML code. Is there any way to get rid of MainActivity and show the HTML directly?

Thanks in Advance...

Pawan
  • 517
  • 1
  • 9
  • 25
  • Why don't you create a phoneGap apk file from cloud system.Here is the [link](https://build.phonegap.com/).This will create your build directly without using android Activity. – AppMobiGurmeet Oct 16 '12 at 08:41
  • "show the HTML directly" where? i'm not familiar with PhoneGap but i'm sure that MainActivity is needed since it contains WebView where your html content is showed ... – Selvin Oct 16 '12 at 08:45

1 Answers1

5

Add this to your AndroidManifest application tag:

android:theme="@android:style/Theme.NoTitleBar"

Should do the trick.

  • Thanks, that does the trick for me. Doy you know also how to change the color of the main window? Because my content is black and now you see first a bright white screen before the content is loaded. – Codebeat Oct 27 '12 at 23:14
  • No problem Pawan :) Erwinus, if I understand correctly, try looking into http://stackoverflow.com/questions/8156841/phonegap-splash-screen-for-android-app. You can have a splashscreen of any color if you want to. – Andrius Virbičianskas Oct 29 '12 at 10:47