Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

163
Views
Passing a value to layout file

I'm trying to display certain tweets using TweetView with fabric but I'm having trouble figuring out how to send the value of the tweetID to the layout file

here's part of the xml:

<com.twitter.sdk.android.tweetui.TweetView
    android:id="@+id/title"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    twittersdk:tw__tweet_id="?????"/>

here is where I have the value of the tweetID

private void render(Marker marker, View view) {
        ScreenResolution screenRes = deviceDimensions();
        String title = marker.getTitle();
        long tweetID = Long.parseLong(marker.getSnippet());
        }
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You cannot pass a value to layout file, instead you can set its value in .java.

As per your need, you may use like:

final LinearLayout tweet_layout
            = (LinearLayout) findViewById(R.id.tweet_layout);

    final List<Long> tweetIds = Arrays.asList(your_tweet_id);
    TweetUtils.loadTweets(tweetIds, new Callback<Tweet>() {
        @Override
        public void success(Result<Tweet> result) {
            for (Tweet tweet : result.data) {
                tweet_layout.addView(new TweetView(TweetActivity.this, tweet));
            }
        }

        @Override
        public void failure(TwitterException exception) {
            // Do something here.
        }
    });
}
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!