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

183
Views
Cómo restablecer datos en la intención createChooser

Cuando el usuario comparte una imagen y presiona cancelar, el selector de creación sigue usando la información de la última llamada, incluso cuando comparte información nueva almacenada allí. ¿Cómo restablecer los datos de intención cuando el usuario cancela el uso compartido?

estoy usando este código para compartir

 private void shareIt() { uri = Uri.fromFile(imagePath); Intent sharingIntent = new Intent(Intent.ACTION_SEND); sharingIntent.setType("image/*"); String shareBody = "try this app"; sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "social share app"); sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody); sharingIntent.putExtra(Intent.EXTRA_STREAM, uri); startActivity(Intent.createChooser(sharingIntent, "share by ..")); }
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Intent sharingIntent = new Intent(Intent.ACTION_SEND); Uri screenshotUri = Uri.parse(path); sharingIntent.setType("image/*"); sharingIntent.putExtra(Intent.EXTRA_STREAM, screenshotUri); startActivity(Intent.createChooser(sharingIntent, "Share image using"));

usa el código anterior

poner este código para manifestar

 <intent-filter> <action android:name="android.intent.action.SEND" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="image/*" /> </intent-filter>
over 4 years ago · Santiago Trujillo Report

0

No está actualizando su ImagePath, por lo que siempre intenta mostrar la misma imagen para compartir, actualice imagePath antes de llamar al método shareIt ()

over 4 years ago · Santiago Trujillo Report
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!