0

I have an issue with the following passage.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    GestureOverlayView gestureOverlayView = new GestureOverlayView(this);
    View inflate = getLayoutInflater().inflate(R.layout.main, null);
    gestureOverlayView.addView(inflate);
    gestureOverlayView.addOnGesturePerformedListener((OnGesturePerformedListener) this);
    gestureLib = GestureLibraries.fromRawResource(null, R.raw.gestures);
    if (!gestureLib.load()) {
      finish();
    }
    setContentView(gestureOverlayView);
  }

    void setContentView(R.layout.main);

R.layout.main gives me the second dot underlined with the following error: Syntax error on token ".", ... expected

rajeshwaran
  • 1,512
  • 1
  • 18
  • 24
wswld
  • 1,218
  • 15
  • 32

1 Answers1

1

Have you tried removing the Error from the debugger? Sometimes Eclipse can get hung on things that just are not there.

Also, it seems like the View does not Know what to call it on. Try passing it a known View for it to work with like TextView, etc. like below.

View inflate = (View) getLayoutInflater().inflate(R.layout.main, null);
childofthehorn
  • 697
  • 1
  • 4
  • 12
  • Yes, removing the error helped to launch the app (of course) but it force closes, not sure whether that's because of this exact line. It didn't force close, when it was commented, though. – wswld Nov 10 '12 at 05:00