Using "WelcomeScreen.this" instead of "this" should take care of the problem Richard pointed out for this case.
On Oct 27, 6:09 pm, RichardC <[email protected]> wrote: > The "this" you are passing into new Intent is an anonymous derived > class of View.OnClickListener not your derived Activity class > WelcomeScreen. > > You will need to ask someone who knows more Java than I do how to get > at "this" in your outer class. > > -- > RichardC > > On Oct 27, 9:48 pm, tatman <[email protected]> wrote: > > > btw, I have class called RootGameScreen in my workspace, namespace.... > > > On Oct 27, 5:43 pm, tatman <[email protected]> wrote: > > > > In the notepad2.java example, the sample allocates an intent like > > > this: > > > > private void createNote() { > > > // TODO: fill in implementation > > > Intent i = new Intent(this, NoteEdit.class); > > > startActivityForResult(i, ACTIVITY_CREATE); > > > } > > > > I effectively copied that code, changed it fit for me, but it does not > > > "compile" with error constructor doesn't exist. The "quick fix" > > > according to Eclipse is to remove the parameters. I'm confused....any > > > help would be appreciated.... > > > > package com.bigwoo; > > > > import android.app.Activity; > > > import android.content.Intent; > > > import android.os.Bundle; > > > import android.view.View; > > > import android.widget.Button; > > > > // startup screen > > > public class WelcomeScreen extends Activity > > > { > > > private static final int ACTIVITY_GAMEON=0; > > > > /** Called when the activity is first created. */ > > > @Override > > > public void onCreate(Bundle savedInstanceState) > > > { > > > super.onCreate(savedInstanceState); > > > setContentView(R.layout.main); > > > > Button button = (Button) findViewById(R.id.startgameBtnId); > > > button.setOnClickListener(new View.OnClickListener() > > > { > > > public void onClick(View v) > > > { > > > Intent startGameIntent = new Intent(this, > > > RootGameScreen.class); > > > startActivityForResult(startGameIntent, > > > ACTIVITY_GAMEON); > > > } > > > }); > > > > } > > > > } --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

