Reputation: 1900
How do you change activities using DroidGap? Is there a way to get the current context even though we're using DroidGap?
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();
}
}
Upvotes: 1
Views: 724
Reputation: 1900
This solved my problem Intent myIntent = new Intent(getContext(), LoadScreen.class);
Upvotes: 1