Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

191
Views
envíe un mensaje de whatsapp al número dado en el código con un texto preespecificado al hacer clic en FloatingActionButton Whatsapp

A continuación se muestra el código y el error es: cuando hago clic en el botón, me lleva al mercado como en la tienda de juegos para instalar WhatsApp, pero WhatsApp ya está instalado. Quiero abrir Whatsapp del número dado en el código con el texto especificado.

 //whatsapp code fab_whatsapp.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { String smsNumber = "918291332142"; boolean isWhatsappInstalled = whatsappInstalledOrNot ("com.whatsapp"); if (isWhatsappInstalled) { Intent sendIntent = new Intent(Intent.ACTION_VIEW); String url = "https://api.whatsapp.com/send?phone=" + "918291332142" + "&text=" + "Hello World!"; sendIntent.setType("text/plain"); sendIntent.putExtra(Intent.EXTRA_TEXT, "Hi, this is a test message"); sendIntent.setPackage("com.whatsapp"); startActivity(sendIntent); }else { Toast.makeText(MainActivity.this, "Whatsapp not Installed", Toast.LENGTH_SHORT).show(); Uri uri = Uri.parse("market://details?id=com.whatsapp"); Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri); startActivity(goToMarket); } } }); private boolean whatsappInstalledOrNot(String uri) { PackageManager pm = getPackageManager(); boolean app_installed = false; try { pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES); app_installed = true; } catch (PackageManager.NameNotFoundException e) { app_installed = false; } return app_installed; }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!