0

method does not override method from superclass. how can i fix this error. im making and android native app for my website.and my website contain a button which amy app defining as unknown url error so i add the code (shared in screenshote) but after that is showing a error and its not working, im doing making this app without any pre knowledge of java or android app development please help me out to solve this issue . everything is working fine instead of whatsapp url

method does not override method from superclass. how can i fix this error.
im making and android native app for my website.

  • ' @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { boolean overrideUrlLoading = false; if (url != null && url.startsWith("whatsapp://")) { view.getContext().startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url))); overrideUrlLoading = true; } else { view.loadUrl(url); } return overrideUrlLoading; } ' – Istiack Mohammad Nov 28 '21 at 15:35

2 Answers2

2

With this code, you're saying that there is a method shouldOverrideUrlLoading in your superclass. Superclass is the class you extend. Example:

public class MainActivity extends ExampleClass { }

To override a method, there needs to be a

protected void shouldOverrideUrlLoading(){ }

method in ExampleClass.

If you didn't override any class, remove @Override. If you did and must extend a class, you can't go further without inheritance knowledge.

Misa
  • 21
  • 2
0

MainActivity and this superclass not has shouldOverrideUrlLoading method

yan sam
  • 387
  • 1
  • 7