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());
}
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.
}
});
}