PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV Mobile 2024
→
[WM17] Partager un texte sur Twitter, Facebook, etc
[WM17] Partager un texte sur Twitter, Facebook, etc
Started by zinehom, Mar., 11 2013 4:47 PM - 1 reply
Connect yourself…
zinehom
#1
Posted on March, 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
Report
0
0
Reginald Dupuis
#2
Posted on May, 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 "";
}
}
Report
0
0
→ Go back to WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
WEBDEV (earlier versions)
WINDEV Mobile (earlier versions)
Reports & Queries
Off-topic
Tools
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text