AdobeNativeExtensionforAndroid,当试图从浏览器返回时,应用程序在返回按钮上崩溃

AdobeNativeExtensionforAndroid,当试图从浏览器返回时,应用程序在返回按钮上崩溃,android,crash,adobe,air-native-extension,Android,Crash,Adobe,Air Native Extension,我已经为第三方广告商(TrialPay)创建了一个本机扩展(Android),它需要加载webview并在本机浏览器中进一步打开url。之后,它要求点击“后退”按钮,以便用户可以从本机浏览器返回应用程序,但此时应用程序崩溃 以下是我在本机扩展代码中的活动: public class TrialPayOfferWallActivity extends Activity{ Button doneButton = null; WebView offerWallWebView = null; publ

我已经为第三方广告商(TrialPay)创建了一个本机扩展(Android),它需要加载webview并在本机浏览器中进一步打开url。之后,它要求点击“后退”按钮,以便用户可以从本机浏览器返回应用程序,但此时应用程序崩溃

以下是我在本机扩展代码中的活动:

public class TrialPayOfferWallActivity extends Activity{

Button doneButton = null;
WebView offerWallWebView = null;
public static FREContext freContext;
@SuppressLint({ "NewApi", "SetJavaScriptEnabled" })
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

    //Remove title bar
    this.requestWindowFeature(Window.FEATURE_NO_TITLE);

    //Remove notification bar
    this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

    Log.i(this.getClass().getSimpleName(), "Inside TrialPayOfferWallActivity OnCreate function");

    this.setContentView(freContext.getResourceId("layout.trialpayofferwallactivity"));

    Log.i(this.getClass().getSimpleName(), "1");
    Bundle extraBundleObj = this.getIntent().getExtras();
    Log.i(this.getClass().getSimpleName(), "2");
    String urlString = extraBundleObj.getString("urlString");
    Log.i(this.getClass().getSimpleName(), "3-"+urlString);

    doneButton = (Button) this.findViewById(freContext.getResourceId("id.btnDone"));
    Log.i(this.getClass().getSimpleName(), "4");
    offerWallWebView = (WebView) this.findViewById(freContext.getResourceId("id.offerwallwebview"));
    Log.i(this.getClass().getSimpleName(), "5");
    doneButton.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              setResult(RESULT_OK);
              finish();
          }
        });
    Log.i(this.getClass().getSimpleName(), "6");
    offerWallWebView.getSettings().setJavaScriptEnabled(true);
    offerWallWebView.getSettings().setUseWideViewPort(true);
    offerWallWebView.getSettings().setLoadWithOverviewMode(true);
    offerWallWebView.setScrollBarStyle(WebView.SCROLLBARS_INSIDE_OVERLAY);

    Log.i(this.getClass().getSimpleName(), "7");
    this.loadWebViewWithURL(urlString);
}

public void loadWebViewWithURL(String url2)
{
    offerWallWebView.loadUrl(url2);
    offerWallWebView.setWebViewClient(new WebViewClient() {
      @Override
      public boolean shouldOverrideUrlLoading(WebView view, String url) {
        if (url.startsWith("http:") || url.startsWith("https:")) {
            view.loadUrl(url);
        } else {
            if (url.startsWith("tpbow")) {
                url = url.substring(5);
            }
            Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
            startActivity( intent );
        }
        return true;
    }

    });
}

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
 if (keyCode == KeyEvent.KEYCODE_BACK && (offerWallWebView.getVisibility() == WebView.VISIBLE)) {
    this.goBack(keyCode, event);
    return true;
 } else {
    return super.onKeyDown(keyCode, event);
 }
}

private void goBack(int keyCode, KeyEvent event) {
 if (offerWallWebView.canGoBack()) {
    offerWallWebView.goBack();
 } else {
    super.onKeyDown(keyCode, event);
 }
}
protected void onPause()
{
    super.onPause();
    //sendErrorBack("Cancelled");
    Log.i(this.getClass().getSimpleName(), "onPause");
}

protected void onStop()
{
    super.onStop();
    //sendErrorBack("Cancelled");
    Log.i(this.getClass().getSimpleName(), "onStop");
}

protected void onResume()
{
    super.onResume();
    Log.i(this.getClass().getSimpleName(), "onResume");
}

protected void onStart()
{
    super.onStart();
    Log.i(this.getClass().getSimpleName(), "onStart");
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    Log.i(this.getClass().getSimpleName(), "Inside OnActivityResult function");
    if (resultCode == RESULT_OK) {
        Log.i(this.getClass().getSimpleName(), "Inside OnActivityResult function->result ok");
    }

}
}


我遗漏了什么吗?

堆栈跟踪显示了什么?在返回后按浏览器上的“后退”按钮尝试重新加载应用程序时,创建相同活动时出现空指针异常。。。