ich hätte mal ein Problem = ) , ich hab eine Viewer Klasse in der ich AlertDialog habe, beim Klicken auf einem bestimmten Button des AlertDialoges
möchte ich eine neue Activity öffnen. Wenn ich ein Intent an die OnClick methode fügen möchte, wirft mir Eclipse Fehler vor.
Zuerst initialisiere ich ein Intent, das klappt noch ohne Probleme.
Wenn ich hab eine Klasse setzen möchte, bekomme ich folgenden Fehler "The Method set'Class(context, Class ) in the Type Intent is not applicable
for the arguments (MotionPathView, LevelAnzeige)"
Und bei start Activity(intent) "The Method ist undefined for the Type New DialogInterface"
Ich hoffe mal das ihr mir Helfen könnt, so wie es immer ist = )
Gruß
max
1builder.setMessage("Was möchte Sie mit Ihrer Gurke tun?").setPositiveButton("Save", new DialogInterface.OnClickListener() {
2 public void onClick(DialogInterface dialog, int which) {
3 savePoints(points);
4 }
5 }).setNegativeButton("New", new DialogInterface.OnClickListener() {
6 public void onClick(DialogInterface dialog, int which) {
7 points.clear();
8 lineCanvas.drawColor(Color.BLACK);
9 }
10 }).setNeutralButton("Finish", new DialogInterface.OnClickListener() {
11 public void onClick(DialogInterface dialog, int which) {
12
13 /*Intent levelintent = new Intent();
14 levelintent.setClass(MotionPathView.class, LevelAnzeige.class);
15 startActivity(levelintent);*/
16
17 Intent intent = new Intent();
18
19 intent.setClass(MotionPathTest.this, LevelAnzeige.class);
20 startActivity(intent);
21 }
22
23
24 });
25
26
27 AlertDialog alert = builder.create();
28 alert.show();
2 public void onClick(DialogInterface dialog, int which) {
3 savePoints(points);
4 }
5 }).setNegativeButton("New", new DialogInterface.OnClickListener() {
6 public void onClick(DialogInterface dialog, int which) {
7 points.clear();
8 lineCanvas.drawColor(Color.BLACK);
9 }
10 }).setNeutralButton("Finish", new DialogInterface.OnClickListener() {
11 public void onClick(DialogInterface dialog, int which) {
12
13 /*Intent levelintent = new Intent();
14 levelintent.setClass(MotionPathView.class, LevelAnzeige.class);
15 startActivity(levelintent);*/
16
17 Intent intent = new Intent();
18
19 intent.setClass(MotionPathTest.this, LevelAnzeige.class);
20 startActivity(intent);
21 }
22
23
24 });
25
26
27 AlertDialog alert = builder.create();
28 alert.show();
