Uri file path resolved to null

android

#1
    TwitterSession session = TwitterCore.getInstance().getSessionManager().getActiveSession();
    Card card = new Card.AppCardBuilder(context).imageUri
    (Uri.parse("https://upload.wikimedia.org/wikipedia/en/2/24/Lenna.png"))
    .build();
          
    Intent intent = new ComposerActivity.Builder(context).
            session(session).card(card).createIntent();
    context.startActivity(intent);

I got “com.twitter.sdk.android.core.TwitterException: Uri file path resolved to null” when I try to use App card. And I think this image is valid because I found this url from wiki. Could you please help me about this problem? By the way, is there any method to use App Card with a content like send a tweet?


#2

You must specify a Card image Uri to a media file on the device. See: https://docs.fabric.io/android/twitter/compose-tweets.html#requirements