GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEV
,
WEBDEV
e
WINDEV Mobile
Inicio
|
Mensagens recentes
|
Conecte-se...
|
Disconnect
|
Português
Inicio
→
WINDEV Mobile 2024
→
[WM17] Partager un texte sur Twitter, Facebook, etc
[WM17] Partager un texte sur Twitter, Facebook, etc
Iniciado por zinehom, mar., 11 2013 4:47 PM - 1 resposta
Conecte-se…
zinehom
#1
Publicado em março, 11 2013 - 4:47 PM
Bonsoir, je cherche à partager du texte sur les réseaux sociaux, j'ai crée une procédure global en java:
import android.content.Intent;
import android.content.Context;
import android.widget.EditText;
public static void gPG_Share()
{
Context tmpContext = getContexteApplication();
EditText text;
text = (EditText) getView ("texte");
Intent MessIntent = new Intent(Intent.ACTION_CHOOSER);
MessIntent.setType("text/plain");
MessIntent.putExtra(Intent.EXTRA_TEXT, text.getText().toString());
tmpContext.startActivity(Intent.createChooser(MessIntent, "Partager avec..."));
}
après l’exécution de mon application, elle m'affiche l'erreur suivante:
erreur interne du framework wdjava.java.lang.NullPointerExecption
Denunciar
0
0
Reginald Dupuis
#2
Publicado em maio, 23 2013 - 6:44 PM
Je coince aussi sur le meme sujet. on peut récupérer l'erreur avec
try {
... votre code
} catch(Exception e)
{
String sError = e.getMessage(); // "There are no email clients installed."
Toast.makeText(context,sError,Toast.LENGTH_LONG).show();
return "";
}
import android.view.*;
import android.content.Context;
import android.widget.TextView;
//
http://doc.pcsoft.fr/es-ES/?particularites-des-applications-pour-android
public static String JavaComboLit(String champ)
{
// Variables
Context context = getApplicationContext();
try {
View viewChamp = (TextView) getView(champ);
//String sValue = viewChamp.getText() //cast return error 'cannot cast'
Toast.makeText(context,champ+sValue,Toast.LENGTH_SHORT).show(); // debug
//return sValue;
return "";
} catch(Exception e)
{
String sError = e.getMessage(); // "There are no email clients installed."
Toast.makeText(context,sError,Toast.LENGTH_LONG).show();
return "";
}
}
Denunciar
0
0
→ Voltar para WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (versões anteriores)
WEBDEV (versões anteriores)
WINDEV Mobile (versões anteriores)
Reports & Queries
Off-topic
Ferramentas
Français
English
Español
Portuguesa
Fermer cette fenêtre
Tipo de Pesquisa
Apenas tópicos
Todas as mensagens
Período de pesquisa
Qualquer momento
Última hora
Últimas 24 horas
Semana passada
Mês passado
Ano passado
Cancelar
Pré-visualização da sua mensagem
Adicionar imagem
Importar uma imagem de uma URL
Enviar uma imagem a partir do seu disco
Deixe um ficheiro ou clique em "Procurar ..."
ou
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto