Hi i have a html file in asset folder and load it in webview using below code it play sound file but do not load html file until i click the button 1 time more where is th problem? Thank you in advance.
final Dialog helploaderdialog=new Dialog(this);
helploaderdialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
helploaderdialog.setContentView(R.layout.helploaderdialog);
final WebView webViewHelpLoaderDialog=(WebView)helploaderdialog.findViewById(R.id.webViewHelpLoaderDialog);
//--------------End ActionBarCod-------------------
final Button BtHelpAppUsing=(Button)findViewById(R.id.BtHelpAppUsing);
BtHelpAppUsing.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
// TODO Auto-generated method stub
appusing="Play";
webViewHelpLoaderDialog.loadUrl("file:///android_asset/"+"appusing.html");
webViewHelpLoaderDialog.setWebViewClient(new WebViewClient() {
public void onPageFinished(WebView view, String url) {
// do your stuff here
new CountDownTimer(300,1000){
@Override
public void onTick(long millisUntilFinished){}
@Override
public void onFinish(){
// your code
if(appusing=="Play")
{
MediaPlayer player = MediaPlayer.create(ActivityHelpAndSupport.this, R.raw.appusing);
player.setVolume(100,100);
player.start();
appusing="false";
}
}
}.start();
}
});
helploaderdialog.show();
}
});