2014-03-31 4 views
0

내 응용 프로그램에서 webview를 팽창 시키려고합니다.클릭 webview inflated crash

03-31 09:39:14.278: W/System.err(1825): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=market://details?id=air.com.goodgamestudios.empirefourkingdoms&referrer=mat_click_id=c5e82ec15ac735af3b-20140331-4066 } 

당신이 날 도와 줄 수 : 응용 프로그램이

viewGroup = (ViewGroup)activity.findViewById(android.R.id.content); 

     activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); 

     final TextView textViewCompteur ; 
     ImageView ic_close ; 

     final View inflater = activity.getLayoutInflater().inflate(R.layout.interstitial_ads, null, true); 

     webView = (WebView)inflater.findViewById(R.id.webViewSplashAds); 
     ic_close = (ImageView)inflater.findViewById(R.id.imageViewCloseSplashAds); 
     textViewCompteur = (TextView)inflater.findViewById(R.id.textViewSplashAds); 

     webView.setWebChromeClient(new WebChromeClient()); 
     webView.getSettings().setJavaScriptEnabled(true); 
     webView.setClickable(true); 

     webView.setLayoutParams(new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT)); 

     AppehourTools.disableAdsScroll(webView); 

     // icone de fermeture 
     ic_close.setOnClickListener(new OnClickListener() { 
      @Override 
      public void onClick(View v) { 

       viewGroup.removeView(inflater); 
       activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); 
       showBar(); 

      } 
     }); 

     webView.setBackgroundColor(Color.BLACK); 
     webView.loadData("<html><head><style type=\"text/css\">body{margin:0 auto;text-align:center;}</style></head><body>" 
       + array.get(0).getUrl() 
       + "</body></html>", "text/html", "utf8"); 
     Log.d("AppehourInterstitialAds", "showing ad"); 


     hideBar(); 

     webView.setWebViewClient(new WebViewClient() { 

      public void onPageFinished(WebView view, String url) { 

       int delayClose; 
       delayClose = Integer.valueOf(array.get(0).getValidDelay()); 
       viewGroup.addView(inflater); 


       new CountDownTimer(delayClose * 1000, 1000) { 

        public void onTick(long millisUntilFinished) { 

         textViewCompteur.setText(millisUntilFinished/1000 
           + " " 
           + context.getString(R.string.seconds_remaining)); 

        } 

        public void onFinish() { 

         viewGroup.removeView(inflater); 
         activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); 
         showBar(); 
        } 
       }.start(); 
      } 


      public boolean shouldOverrideUrlLoading(WebView view, String url) { 

       hideBar(); 
       viewGroup.removeView(inflater); 
       Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); 
       //i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
       activity.startActivity(i); 

       return super.shouldOverrideUrlLoading(view, url); 

      } 
     }); 
    } 

그리고 오류를 충돌한다 웹보기 부하에 마무리하고 그 이후 : 난 브라우저 시작하지만 응용 프로그램 충돌을 클릭하면? 고맙습니다

+0

해당 URL에 설치된 시장 애플리케이션이 필요합니다. – Blackbelt

답변

2

에뮬레이터에서이 앱을 실행하는 경우 'Play 스토어'앱이 설치되어 있지 않기 때문에 앱이 다운됩니다. 이 프로그램을 실행하기 전에 기기에 Play 스토어가 설치되어 있는지 확인하십시오.

+0

실제 장치로 작업 해 주셔서 감사합니다! – Flofloaud1034