Vignesh Sundaramoorthy
Vignesh Sundaramoorthy

Reputation: 1887

How to pass Typeface(not custom font path) to another activity or store in SharedPreference

I am getting the Typeface as a parameter from the integrating application to my SDK. How can I store it in SharedPrefrences or pass to another Activity?

The integrating application can send the inbuilt typeface like Typeface.SERIF or they can create a custom typeface using Typeface.createFromAsset(context.getAssets(), fontAssetPath)

So, how can I use the given Typeface in different places of my SDK?

Upvotes: 2

Views: 225

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007474

How can I store it in SharedPrefrences

You can't. You would have to store enough information to re-create the Typeface.

or pass to another Activity?

You can't. You would have to pass enough information to allow the other activity re-create the Typeface.

Upvotes: 2

Related Questions