1
如何使用DroidGap更改活動?即使我們使用DroidGap,是否有辦法獲得當前的上下文?在android上使用phonegap更改活動
public class MainActivity extends DroidGap {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (isOnline() == true) {
super.loadUrl("http://myurl.com");
}
else {
Intent myIntent = new Intent(SOME CONTEXT...DroidGap.getContext(), LoadScreen.class);
startActivity(myIntent);
finish();
}
}
你已經寫了解決方案。作爲上下文,您可以使用您當前的活動 – marwinXXII 2012-08-05 12:16:00
@marwinXXII以及'DroidGap.getContext()'的特定代碼會返回一個錯誤,指出getContext不是靜態方法。我如何得到當前的背景是我的問題。 – Mobie 2012-08-05 18:09:44