Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

180
Vistas
How to reset data in createChooser intent

When user do share image and press cancel the createchooser keep using information from last call ,even when i he does new share still old informations stored there. How to reset intent data when user cancel sharing ??

i am using this code for sharing

 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 Respuestas
Responde la pregunta

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"));

use bove code

put this code to manifest

<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 Denunciar

0

You are not update your ImagePath, So all the time intent show same Image for share, update imagePath before call shareIt() method

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda