我有一个嵌入了CordovaWebView的应用程序。根据指令,在这种情况下,我不应该从DriodGap扩展我的活动。
public class CordovaViewTestActivity extends Activity implements CordovaInterface {
CordovaWebView cwv;
/* Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
cwv = (CordovaWebView) findViewById(R.id.tutorialView);
cwv.loadUrl("file:///android_asset/www/index.html");
}
}但我需要使用闪屏。根据指示,我必须这样做:
super.setIntegerProperty("splashscreen", R.drawable.splash);
super.loadUrl("file:///android_asset/www/index.html", 10000);但我的活动不是从DroidGap扩展而来的。我该如何解决这个问题?
发布于 2013-05-08 12:42:49
编辑位于Eclipse中src文件夹中的项目的主Java文件:
执行以下操作:
从DroidGap到

发布于 2013-06-04 05:04:29
你可以实现一个常规的android闪屏。这是关于安卓闪屏的一个很好的stackoverflow讨论:How do I make a splash screen?
另一种给人留下闪屏印象的方法是让你的登录页面看起来像一个闪屏,并插入一个javascript函数,该函数将在几秒钟后被调用,并将调用你当前的登录页面(这样你就有了所有平台的“闪屏”)。
一个javascript函数可能如下所示(假设你的主页是'index.html':
function loadMainPage(){
setTimeout(function(){this.document.location.href = "index.html"}, 2000);
}https://stackoverflow.com/questions/16432686
复制相似问题