Witajcie. Jako, że jestem specem bardziej od stron internetowych mało wiem o Java Android.
Może ktoś mi wskazać gdzie mam błąd? Errora wywala mi w linijce 25.
package com.google.android.application;
import android.app.Activity;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;
class TapCircle extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
FrameLayout fLayout = (FrameLayout)findViewById(R.id.main_view);
//1
fLayout.addView(new Circle(this,50,50,25));
//2
fLayout.setOnTouchListener(new View.OnTouchListener() {
@Override
super boolean onTouch(View v, MotionEvent event) {
float x = event.getX();
float y = event.getY();
FrameLayout fl = (FrameLayout)v;
fl.addView(new Circle(getParent(),x,y,25));
return false;
}
});
}
}