Matteo
unread,Jan 11, 2012, 9:29:06 PM1/11/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to JTwitter
Hello,
I'm using Eclipse Indigo, and on my simulator if I try to post the
same message twice the application instead of returning a
TwitterException throws a runtime java.lang.NullPointerException.
Is there any way to avoid it? I tried both with AsyncTask and normal
Activity, but no luck so far.
public void onClick(View v)
{
String status = editText.getText().toString();
try
{
try
{
YambaApplication yamba = (YambaApplication)
getApplication();
winterwell.jtwitter.Status twitterStatus =
yamba.getTwitter().updateStatus(status);
Toast.makeText(StatusActivity.this, twitterStatus.getText(),
Toast.LENGTH_LONG).show();
} catch (TwitterException e)
{
Toast.makeText(StatusActivity.this, "Twitter Error: " +
e.toString(), Toast.LENGTH_LONG).show();
}
} catch (RuntimeException e)
{
Toast.makeText(StatusActivity.this, "Runtime Error: " +
e.toString(), Toast.LENGTH_LONG).show();
}
Log.d(TAG, "button in PostToTwitter onClick 'ed");
}