0

This used to work...

package mirrodinwatchfaces.mywebviewapp;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.webkit.WebView;

public class MainActivity extends AppCompatActivity {


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        //WebView myWebView;
        WebView myWebView = findViewById(R.id.article);
        myWebView.getSettings().setDomStorageEnabled(true);
        myWebView.loadUrl("article.html");

    }

    }

Now its highlighting the R in red...?

Also any changes I make to activity_main.xml are no longer appearing in the Layout Editor...just about impossible to build an html intro screen without actually seeing whether icons and text are being correctly positioned.

Why monopolize the android development environment and then actually make it harder to develop apps...surely this stuff should get priority on the fix list? so glad my business doesnt depend on this bloated beast.

Bharata
  • 13,509
  • 6
  • 36
  • 50

1 Answers1

0

After rummaging around the internet for several hours the answer to this problem comes in many variants and there appears to be no definitive answer.

You can:

  1. Clean and rebuild project (didn't work for me)

or

  1. Check all your .xml files for syntax or reference errors (this put me on the right track)

or

  1. Check through the error logs to get a better idea of where in your project the error is emanating from...in mine it turns out to be a colour reference SOMEWHERE!! I haven't tracked down the actual line of code yet. AS Error logs give LOTS of information but are not necessarily helpful.

or

  1. Trawl the internet but be careful to make sure you're looking at recent posts, i.e. AS 3.4 or this year (2018) as its undergone many many revisions and there are lots of outdated posts and "teaching examples", e.g. trying to learn about WebView sent me around in merry circles and I still can't get it working.

or

  1. Invalidate the cache and restart (didn't work for me)

or

  1. Make sure all your SDKs are upto date (didn't work for me)

Ultimately I don't know enough Java to know exactly what the R thingy is, some kind of object pointer.