android - Show floating action button depending on the URL -


this first question after reading , implementing methods i've learned here... have question:

i'm creating webview, show floating button when open images, know pictures have "fbcdn.net" in url.

but don't know how hide button "descarga" if url not contain "fbcdn.net"

thank answers.

this code:

final string weburl1 = webview.geturl();      if(weburl1.contains("fbcdn.net") ){         descarga.show();          descarga.setonclicklistener(new view.onclicklistener() {             public void onclick(view v) {                   clipboardmanager clipboard = (clipboardmanager) getsystemservice(context.clipboard_service);                  clipdata clip = clipdata.newplaintext(null, weburl1);                 clipboard.setprimaryclip(clip);                 toast.maketext(getapplicationcontext(), "copied clipboard!", toast.length_short).show();               }         });         descarga.hide();     } 

assuming descarga floatingactionbutton, instead of using hide()/show() try using descarga.setvisibility(view.gone) (for hiding fab) , descarga.setvisibility(view.visible) (for showing fab).


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -