“myWebView can not be resolved”












1















I'm trying to create a webview application by the platform called sketchware, which is an application available in the play store that allows you to create your own application. Well, I created a webview application, which loads the page from my site, except that my site has pop-up advertisements, which appear out of nowhere as you click somewhere on the page, and that's what I want the webview application does that it open the links of the site pop-up ads (when they are clicked) in the external browser (type Chrome) and only open the links within the webview app that are based on my own site, own pages of my site, not the pages of advertisements when they are clicked. So I was wondering how I can add this code correctly in my webview application made in sketchware.



I put this code in sketchware, but it always gives an error at the time I'm going to build the application to create it, and I do not know how to fix that error that it is giving. There are always two massages of this here: "myWebView can not be resolved".



But I do not know what to do to try to solve this code for it to work. I do not understand virtually anything, and I do not know how to fix this code so do not give that mistake anymore. Can anyone help a beginner like me to solve this problem? Thanks in advance!





myWebView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {

if (url.contains("http://www.youradress.com")) {
myWebView.loadUrl(url);
return false;
} else {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
startActivity(intent);
return true;
}

}
});









share|improve this question

























  • Don't post (links to) an image of text! Instead add the text itself as an edit to the question. BTW - is this Android based? Which GUI component toolkit is being used here? General tip: For better help sooner, edit to add a Minimal, Complete, and Verifiable example or Short, Self Contained, Correct Example.

    – Andrew Thompson
    Nov 23 '18 at 1:43


















1















I'm trying to create a webview application by the platform called sketchware, which is an application available in the play store that allows you to create your own application. Well, I created a webview application, which loads the page from my site, except that my site has pop-up advertisements, which appear out of nowhere as you click somewhere on the page, and that's what I want the webview application does that it open the links of the site pop-up ads (when they are clicked) in the external browser (type Chrome) and only open the links within the webview app that are based on my own site, own pages of my site, not the pages of advertisements when they are clicked. So I was wondering how I can add this code correctly in my webview application made in sketchware.



I put this code in sketchware, but it always gives an error at the time I'm going to build the application to create it, and I do not know how to fix that error that it is giving. There are always two massages of this here: "myWebView can not be resolved".



But I do not know what to do to try to solve this code for it to work. I do not understand virtually anything, and I do not know how to fix this code so do not give that mistake anymore. Can anyone help a beginner like me to solve this problem? Thanks in advance!





myWebView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {

if (url.contains("http://www.youradress.com")) {
myWebView.loadUrl(url);
return false;
} else {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
startActivity(intent);
return true;
}

}
});









share|improve this question

























  • Don't post (links to) an image of text! Instead add the text itself as an edit to the question. BTW - is this Android based? Which GUI component toolkit is being used here? General tip: For better help sooner, edit to add a Minimal, Complete, and Verifiable example or Short, Self Contained, Correct Example.

    – Andrew Thompson
    Nov 23 '18 at 1:43
















1












1








1








I'm trying to create a webview application by the platform called sketchware, which is an application available in the play store that allows you to create your own application. Well, I created a webview application, which loads the page from my site, except that my site has pop-up advertisements, which appear out of nowhere as you click somewhere on the page, and that's what I want the webview application does that it open the links of the site pop-up ads (when they are clicked) in the external browser (type Chrome) and only open the links within the webview app that are based on my own site, own pages of my site, not the pages of advertisements when they are clicked. So I was wondering how I can add this code correctly in my webview application made in sketchware.



I put this code in sketchware, but it always gives an error at the time I'm going to build the application to create it, and I do not know how to fix that error that it is giving. There are always two massages of this here: "myWebView can not be resolved".



But I do not know what to do to try to solve this code for it to work. I do not understand virtually anything, and I do not know how to fix this code so do not give that mistake anymore. Can anyone help a beginner like me to solve this problem? Thanks in advance!





myWebView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {

if (url.contains("http://www.youradress.com")) {
myWebView.loadUrl(url);
return false;
} else {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
startActivity(intent);
return true;
}

}
});









share|improve this question
















I'm trying to create a webview application by the platform called sketchware, which is an application available in the play store that allows you to create your own application. Well, I created a webview application, which loads the page from my site, except that my site has pop-up advertisements, which appear out of nowhere as you click somewhere on the page, and that's what I want the webview application does that it open the links of the site pop-up ads (when they are clicked) in the external browser (type Chrome) and only open the links within the webview app that are based on my own site, own pages of my site, not the pages of advertisements when they are clicked. So I was wondering how I can add this code correctly in my webview application made in sketchware.



I put this code in sketchware, but it always gives an error at the time I'm going to build the application to create it, and I do not know how to fix that error that it is giving. There are always two massages of this here: "myWebView can not be resolved".



But I do not know what to do to try to solve this code for it to work. I do not understand virtually anything, and I do not know how to fix this code so do not give that mistake anymore. Can anyone help a beginner like me to solve this problem? Thanks in advance!





myWebView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {

if (url.contains("http://www.youradress.com")) {
myWebView.loadUrl(url);
return false;
} else {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
startActivity(intent);
return true;
}

}
});






javascript java browser webview






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 23 '18 at 5:07









李哲源

48.7k1497151




48.7k1497151










asked Nov 22 '18 at 23:57









Norman BatesNorman Bates

62




62













  • Don't post (links to) an image of text! Instead add the text itself as an edit to the question. BTW - is this Android based? Which GUI component toolkit is being used here? General tip: For better help sooner, edit to add a Minimal, Complete, and Verifiable example or Short, Self Contained, Correct Example.

    – Andrew Thompson
    Nov 23 '18 at 1:43





















  • Don't post (links to) an image of text! Instead add the text itself as an edit to the question. BTW - is this Android based? Which GUI component toolkit is being used here? General tip: For better help sooner, edit to add a Minimal, Complete, and Verifiable example or Short, Self Contained, Correct Example.

    – Andrew Thompson
    Nov 23 '18 at 1:43



















Don't post (links to) an image of text! Instead add the text itself as an edit to the question. BTW - is this Android based? Which GUI component toolkit is being used here? General tip: For better help sooner, edit to add a Minimal, Complete, and Verifiable example or Short, Self Contained, Correct Example.

– Andrew Thompson
Nov 23 '18 at 1:43







Don't post (links to) an image of text! Instead add the text itself as an edit to the question. BTW - is this Android based? Which GUI component toolkit is being used here? General tip: For better help sooner, edit to add a Minimal, Complete, and Verifiable example or Short, Self Contained, Correct Example.

– Andrew Thompson
Nov 23 '18 at 1:43














0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53439226%2fmywebview-can-not-be-resolved%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53439226%2fmywebview-can-not-be-resolved%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

If I really need a card on my start hand, how many mulligans make sense? [duplicate]

Alcedinidae

Can an atomic nucleus contain both particles and antiparticles? [duplicate]