我正在开发Hybrid Phonegap / Native Android应用程序。从ActivityA过渡到ActivityB时,会出现黑屏。我想在显示ActivityB之前防止闪烁。
import org.apache.cordova.DroidGap;
import android.os.Bundle;
import android.view.Menu;
public class ActivityA extends DroidGap
{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.init();
//setContentView(R.layout.activity_main);
super.loadUrl("file:///android_asset/www/index.html");
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
public class ActivityB extends DroidGap
{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.init();
super.loadUrl("file:///android_asset/www/view.html");
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}