Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It looks to me that the var <code>TAG_url</code> is intended to be used only as a descriptor, not as a mutable object. First you have: <code>private static final String TAG_url = "url";</code> defined as a node name. Using that for <code>txtDesc.setText(product.getString(TAG_url));</code> works because you're retrieving the data associated with the node "url" (which is what <code>TAG_url</code> holds). In that instance, the data is not in the <code>TAG_url</code> var, but uses <code>TAG_url</code> as the key to find the data. </p> <p>Any log reference to <code>TAG_url</code> will return it's contents: <code>url</code>. By the same token, a parse call using <code>TAG_url</code> will use it's contents as well. Therefore, <code>Uri uri = Uri.parse(TAG_url);</code> is actually calling <code>Uri uri = Uri.parse("url");</code> - and so the error.</p> <p>You should replace the <code>TAG_url</code> in the parse call with a var holding the actual url you intend to call. During your database call, you should store that url in a separate var, and parse it instead.</p> <p>Edit:</p> <p>Without knowing the structure of your JSON or other data, I can't say for certain. But as example, lets assume that the data returned from the database via the call <code>product.getString(TAG_url)</code> is the data you want sent to the parser. (I'm assuming that since you mentioned the data was correctly set to the TextView <code>txtDesc</code> when called via <code>txtDesc.setText(product.getString(TAG_url));</code>.) </p> <p>Given that, you could create a field <code>String incomingURL;</code> at the top of the class, and assign the result of the database call like <code>incomingURL = product.getString(TAG_url);</code>. You would then set the TextView with the new field like <code>txtDesc.setText(incomingURL);</code>.</p> <p>Then, use that variable for your parse: <code>Uri uri = Uri.parse(incomingURL);</code> That would take the data from the database call, and place it in the parser. Just keep in mind that you'll need to check for <code>incomingURL</code> being null if the button is clickable before the database call completes.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload