2013-06-13 3 views

답변

3

먼저 여기에 코드 자세한 내용은

ConfigurationBuilder configurationBuilder = new ConfigurationBuilder(); 
     configurationBuilder.setOAuthConsumerKey(context.getResources().getString(R.string.twitter_consumer_key)); 
     configurationBuilder.setOAuthConsumerSecret(context.getResources().getString(R.string.twitter_consumer_secret)); 
     configurationBuilder.setOAuthAccessToken(LoginActivity.getAccessToken((context))); 
     configurationBuilder.setOAuthAccessTokenSecret(LoginActivity.getAccessTokenSecret(context)); 
     Configuration configuration = configurationBuilder.build(); 
     final Twitter twitter = new TwitterFactory(configuration).getInstance(); 

     new Thread(new Runnable() { 

       private double x; 

       @Override 
       public void run() { 
         boolean success = true; 
         try { 
           x = Math.random(); 
           twitter.updateStatus(message +" "+x); 
         } catch (TwitterException e) { 
           e.printStackTrace(); 
           success = false; 
         } 

         final boolean finalSuccess = success; 

         callingActivity.runOnUiThread(new Runnable() { 
           @Override 
           public void run() { 
             postResponse.onFinsihed(finalSuccess); 
           } 
         }); 

       } 
     }).start(); 

확인을 트위터에이 tutorial을 메시지를 게시하는 것입니다

트위터

에 응용 프로그램을 작성해야합니다.

0

당신은 트위터에 이미지를 게시 할 의도를 사용할 수 있으며 download full source code

Bitmap b =BitmapFactory.decodeResource(getResources(),R.drawable.ic_launcher); 
Intent share = new Intent(Intent.ACTION_SEND); 
share.setType(“image/jpeg”); 
ByteArrayOutputStream bytes = new ByteArrayOutputStream(); 
b.compress(Bitmap.CompressFormat.JPEG, 100, bytes); 
String path = MediaStore.Images.Media.insertImage(getContentResolver(), b, “Title”, null); 
Uri imageUri = Uri.parse(path); 
share.putExtra(Intent.EXTRA_STREAM, imageUri); 
startActivity(Intent.createChooser(share, “Select”)); 
여기에서 전체 소스 코드를 다운로드 할 수 있습니다
관련 문제