This repository was archived by the owner on Jul 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
java/com/android/samples/webviewdemo Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 2828 < option value ="london "> London</ option >
2929 </ select >
3030 < h1 id ="title "> Location</ h1 >
31- < img alt ="weather " class ="icon " id ="icon " src ="https://raw.githubusercontent.com/res/drawable/sunny.png " />
31+ < img alt ="weather " class ="icon " id ="icon " src ="https://raw.githubusercontent.com/views-widgets-samples/ res/drawable/sunny.png " />
3232 < h2 class ="currentTemp " id ="currentTemp "> Current Temp</ h2 >
3333 < h2 class ="shortDescription " id ="shortDescription "> Short Description</ h2 >
3434 < p class ="longDescription " id ="longDescription "> Long Description</ p >
Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ function getData() {
3030 } ) . then ( function ( data ) {
3131 var form = document . getElementById ( "location" ) ;
3232 var currentLocation = form . options [ form . selectedIndex ] . value ;
33- console . log ( data [ currentLocation ] . description ) ;
3433 document . getElementById ( "title" ) . innerText = form . options [ form . selectedIndex ] . text ;
3534 document . getElementById ( "currentTemp" ) . innerText = `${ data [ currentLocation ] . currentTemp } ` + "\xB0 F" ;
3635 document . getElementById ( "shortDescription" ) . innerText = data [ currentLocation ] . description ;
Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ class MainActivity : AppCompatActivity() {
8282 * origin in this set then it will have the JS object injected into it
8383 * @param onMessageReceived invoked on UI thread with message passed in from JavaScript postMessage() call
8484 */
85+
8586 private fun createJsObject (
8687 webview : WebView ,
8788 jsObjName : String ,
@@ -129,8 +130,8 @@ class MainActivity : AppCompatActivity() {
129130 val binding = ActivityMainBinding .inflate(layoutInflater)
130131 setContentView(binding.root)
131132 val jsObjName = " jsObject"
132- val allowedOriginRules = setOf<String >(" https://gcoleman799.github.io " )
133-
133+ val allowedOriginRules = setOf<String >(" https://raw.githubusercontent.com " )
134+
134135 // Configuring Dark Theme
135136 // *NOTE* : The force dark setting is not persistent. You must call the static
136137 // method every time your app process is started.
You can’t perform that action at this time.
0 commit comments