Skip to content Skip to sidebar Skip to footer

How To Open Common Incomplete Products Link With Different Toolbar In Android Studio

I have an eCommerce website and that has been running as an android app using WebView method. I have basic knowledge in android studio but not depth. My concern is wanna open Secon

Solution 1:

First, it looks like you're trying to filter out links with a contains:

if(url.contains("https://www.ecommerce.in/product/XXXXX"))

But you've made it too restrictive. It is literally looking for "XXXXX" in the URL. Also, this doesn't really get you much in terms of security. WebViews are very dangerous. I'd suggest looking through this link for some basic suggestions.

Anyways, if you just want to open the ProductActivity it looks like all you have to do is update the test as follows:

if (url.startsWith("https://www.ecommerce.in/product/"))

Note if you need that URL then you have to pass it to the ProductActivity as part of the intent and grab it in the ProductActivity, but be sure to verify the URL before just loading it to make sure sit starts with the common part.

It might be that someone is trying to get your Activity to do things it shouldn't be.

Post a Comment for "How To Open Common Incomplete Products Link With Different Toolbar In Android Studio"