Last active
February 14, 2019 07:33
-
-
Save PierfrancescoSoffritti/8a64b583f9c40caa25041a6500302b75 to your computer and use it in GitHub Desktop.
How to build sample apps for Android libraries with just a few lines of code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
val intent = Intent(this, SampleAppTemplateActivity::class.java) | |
intent.putExtra(Constants.TITLE.name, getString(R.string.title)) | |
intent.putExtra(Constants.GITHUB_URL.name, "https://github.com/username/repo") | |
intent.putExtra(Constants.HOMEPAGE_URL.name(), "https://github.com/username/repo/README.md"); | |
intent.putExtra(Constants.PLAYSTORE_PACKAGE_NAME.name(), "com.name.appname"); | |
val examples = arrayOf( | |
ExampleActivityDetails(R.string.name1, R.drawable.icon, ExampleActivity1::class.java), | |
ExampleActivityDetails(R.string.name2, null, ExampleActivity2::class.java) | |
) | |
intent.putExtra(Constants.EXAMPLES.name, examples) | |
startActivity(intent) | |
finish() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment