Skip to content

Commit

Permalink
fix android samples (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmklix authored Oct 3, 2023
1 parent 02ca5f5 commit 4fdc1c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions samples/Android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ android {

sourceSets {
main {
java.srcDir '../..Utils/CommandLineUtils'
java.srcDir '../..BasicPubSub/src/main/java'
java.srcDir '../..Jobs/src/main/java'
java.srcDir '../..Shadow/src/main/java'
java.srcDir '../..CognitoConnect/src/main/java'
java.srcDir '../../Utils/CommandLineUtils'
java.srcDir '../../BasicPubSub/src/main/java'
java.srcDir '../../Jobs/src/main/java'
java.srcDir '../../Shadow/src/main/java'
java.srcDir '../../CognitoConnect/src/main/java'
java.srcDir 'src/main/java'
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,11 @@ class MainActivity : AppCompatActivity(), AdapterView.OnItemSelectedListener {

private fun runSample(name: String) {
val classLoader = Thread.currentThread().contextClassLoader
val sampleClass = classLoader?.loadClass(name);
val sampleClass = try { classLoader?.loadClass(name) } catch(e:Exception) { null }
if (sampleClass == null) {
clearConsole()
writeToConsole("Could not find sample '${name}'")
return
}
writeToConsole("Running sample '${name}'\n")

Expand Down

0 comments on commit 4fdc1c6

Please sign in to comment.