Back to project page Test-SimpleTwitterClient.
The source code is released under:
This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a co...
If you think the Android project Test-SimpleTwitterClient listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.example.Twitter_Android.AsynkTasks; //from w w w . j a v a 2 s . c o m import android.content.Context; import android.os.AsyncTask; import android.os.Bundle; import android.widget.Toast; import com.example.Twitter_Android.Net.Connector; import com.example.Twitter_Android.R; public class TaskReply extends AsyncTask<Bundle, Void, Boolean> { public static final String TWEET_ID = "ID"; public static final String TEXT = "TEXT"; private final Context context; public TaskReply(Context context) { this.context = context; } @Override protected Boolean doInBackground(Bundle... params) { if (params.length > 0) { final Connector connector = new Connector(); Bundle param = params[0]; long tweetID = param.getLong(TWEET_ID, 0); String text = param.getString(TEXT, ""); return connector.replyTo(tweetID, text); } return false; } @Override protected void onPostExecute(Boolean aBoolean) { super.onPostExecute(aBoolean); if (!aBoolean) { showToast(); } } private void showToast() { String message = context.getString(R.string.toast_reply_error); Toast.makeText(context, message, Toast.LENGTH_LONG).show(); } }