Tweet Composer for Android cancel button navigate to twitter app not originating app




I have a question about the “cancel” behavior of tweet composer. The problem is when I hit the “x” button, it navigates to twitter app not the originating activity of my app.

Is there any way to control the behavior. By the way, I saw the posts asking for onSuccess and onFailure callbacks and I’m aware that they are not available on Android SDK.



I got same problem, any updated?
when i use startActivityForResult, it return RESULT_CANCELED only when user clicks back button to exit Twitter app, it don’t return when user clicks discard button on popup



Nothing at all, no body got any solution. I end up telling my QA it’s the same behavior for other apps.


you had better use your own custom input dialog instead of twitterUI. For instance;

 tweetImageView.setOnClickListener(new OnClickListener() {
                public void onClick(View v) {
                  final UserTimeline userTimeline = new UserTimeline.Builder().screenName(getIntent().getStringExtra("username")).build();
        adapter = new TweetAdapter(this, userTimeline);
AlertDialog adialog;
EditText userinput;
String tweetString;

                    aDialog.setButton(DialogInterface.BUTTON_POSITIVE, "TWEET", new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int which) {
                            tweetString = userinput.getText().toString();
                            TwitterSession session = Twitter.getSessionManager().getActiveSession();
                            StatusesService statusesService = Twitter.getApiClient(session).getStatusesService();
                            Callback<Tweet> cb=new Callback<Tweet>() {
                                public void success(Result<Tweet> arg0) {
                                    Toast.makeText(getApplicationContext(), "Tweet Sent", Toast.LENGTH_SHORT).show();
                                public void failure(TwitterException arg0) {
                                    Toast.makeText(getApplicationContext(), "There is an error"+arg0, Toast.LENGTH_SHORT).show();
                            statusesService.update(tweetString, null, null, null, null, null, null, null, cb);
                    aDialog.setButton(DialogInterface.BUTTON_NEGATIVE, "CLOSE", new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int which) {


Has there been any progress on this? I would like to not end up in the Twitter application when I send a tweet or cancel out of the new tweet UI. I would like the user to end up back in my application. Can this be accomplished?


Hi all,

We’re aware of this due to an issue in recent versions of Twitter for Android. We are working on a fix.

closed #8