Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

182
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda