Chris Lubamba
Chris Lubamba

Reputation: 105

Call new activity from Webview

I want to call a activity from a webview

The app crashes ... but it works form a activity to a an others without webview

What point I am missing?

Thank you.

public class AndroidInterface extends Activity{ Context mContext;

AndroidInterface(Context c) {
    mContext = c;
}

public void newactivity(){

    Intent intent = new Intent(mContext, App2Activity.class);
    startActivity(intent);
}

    public void showToast(String toast) {

    Toast.makeText(mContext, toast, Toast.LENGTH_LONG).show();
}

}

through javascript I can only call a toast but not a activiy...

Upvotes: 1

Views: 1037

Answers (1)

Volodymyr
Volodymyr

Reputation: 1047

Try to use Java code from WebView. For example see here: http://android-er.blogspot.com/2011/10/call-javascript-inside-webview-from.html

Upvotes: 0

Related Questions