http://www.catb.org/esr/faqs/smart-questions.html
On Mon, Apr 11, 2016 at 4:13 PM, Thaer Hamza <[email protected]> wrote: > import android.app.Activity; > import android.content.Intent; > import android.view.Menu; > import android.view.MenuItem; > import android.view.View; > import android.view.Window; > import android.view.WindowManager; > import android.webkit.WebChromeClient; > import android.webkit.WebView; > import android.webkit.WebViewClient; > import android.widget.Toast; > > public class MainActivity extends Activity { > > private WebView mWebview ; > @Override > protected void onCreate(Bundle savedInstanceState) { > requestWindowFeature(Window.FEATURE_NO_TITLE); > > setContentView(R.layout.activity_main); > > super.onCreate(savedInstanceState); > > if(!CheckNetClass.checknetwork(getApplicationContext())) > { > Toast.makeText(getApplicationContext(),"Sorry,no internet > connectivty",1).show(); > } > else > { > mWebview = (WebView) findViewById(R.id.webView1); > > mWebview.getSettings().setJavaScriptEnabled(true); // enable > javascript > mWebview.setWebChromeClient(new WebChromeClient()); > > final Activity activity = this; > //mWebview.setVisibility(View.GONE); > mWebview.setWebViewClient(new WebViewClient() { > public boolean shouldOverrideUrlLoading(WebView view, String > url) { > > view.playSoundEffect(android.view.SoundEffectConstants.CLICK); > Toast.makeText(getApplicationContext(),"please Waiting ... > ",1).show(); > if (url != null && url.startsWith("whatsapp://")) { > view.getContext().startActivity( > new Intent(Intent.ACTION_VIEW, Uri.parse(url))); > return true; > } else { > return false; > } > > } > public void onReceivedError(WebView view, int errorCode, String > description, String failingUrl) { > Toast.makeText(activity, description, > Toast.LENGTH_SHORT).show(); > } > @Override > public void onPageFinished(WebView view, String url) { > //hide loading image > findViewById(R.id.imageLoading1).setVisibility(View.GONE); > //show webview > findViewById(R.id.webView1).setVisibility(View.VISIBLE); > //Toast.makeText(getApplicationContext(),"finished",1).show(); > } > > }); > //getSupportActionBar().hide(); > > mWebview .loadUrl("http://www.elitedoctorsonline.com/web-mobile"); > > /*android.support.v7.app.ActionBar actionbar = getSupportActionBar(); > actionbar.setDisplayShowHomeEnabled(false); > actionbar.setDisplayShowTitleEnabled(false);*/ > > //setContentView(mWebview ); > > } > } > /* @Override > public void onResume(){ > super.onResume(); > // put your code here... > if(!CheckNetClass.checknetwork(getApplicationContext())) > { > Toast.makeText(getApplicationContext(),"msg Sorry,no internet > connectivty",1).show(); > } > }*/ > @Override > public void onBackPressed() { > if (mWebview.canGoBack()) { > mWebview.goBack(); > } else { > super.onBackPressed(); > } > } > } > > -- > You received this message because you are subscribed to the Google Groups > "Android Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/android-developers. > To view this discussion on the web visit > https://groups.google.com/d/msgid/android-developers/cef40fb1-4aca-426f-905c-2a1219eda174%40googlegroups.com > <https://groups.google.com/d/msgid/android-developers/cef40fb1-4aca-426f-905c-2a1219eda174%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- ------------------------------------------------------------------------------------------------- TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/android-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/CANCScgi5JkQBgoACKA3a4DMyxUTmTY0Ab4sx8fM9zPDHVkSFGQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

