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

android

#1

Hi

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.

Thanks!


#3

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


#4

Hi

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


#5

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

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

                    aDialog.setView(userinput);
                    
                    aDialog.setButton(DialogInterface.BUTTON_POSITIVE, "TWEET", new DialogInterface.OnClickListener() {
                        
                        @Override
                        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>() {
                                
                                @Override
                                public void success(Result<Tweet> arg0) {
                                    Toast.makeText(getApplicationContext(), "Tweet Sent", Toast.LENGTH_SHORT).show();
                                    
                                }
                                
                                @Override
                                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() {
                        
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            dialog.cancel();
                            
                        }
                    });
                    
                    aDialog.show();
            
                }
            });

#6

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?


#7

Hi all,

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


#8