Mobie
Mobie

Reputation: 1900

Changing activities using phonegap on android

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

Answers (1)

Mobie
Mobie

Reputation: 1900

This solved my problem Intent myIntent = new Intent(getContext(), LoadScreen.class);

Upvotes: 1

Related Questions