Code to Upload any image into Twitter from Android app after integration. | Techbirds
class updateTwitterImageStatus extends AsyncTask { /** * Before starting background thread Show Progress Dialog * */ @Override protected void onPreExecute() { super.onPreExecute(); pDialog = new ProgressDialog(MainActivity.this); pDialog.setMessage(“Updating to twitter…”); pDialog.setIndeterminate(false); pDialog.setCancelable(false); pDialog.show(); } protected String doInBackground(String… args) { File file = new File(Environment.getExternalStorageDirectory() + “/screenshot.jpg”); try { StatusUpdate status = new StatusUpdate(“upload image”); status.setMedia(file); twitter.updateStatus(status);