onClickListener Crash

I’m getting a crash with this code. I think it’s because i’m trying to load two views at once. I’ve been trying to figure this out for a while but I’m sure I’ll have a solution soon.  It must be trying to load two things at once or something. I’ve tried loading a new view and then tried to load a new activity but neither work. I believe that the View Pager is fucking it up somehow but I don’t know how to fix it. I really want to use the View Pager, it works perfectly.

@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.splash);

SplashPager adapter = new SplashPager();
ViewPager myPager = (ViewPager) findViewById(R.id.splashPager);
myPager.setAdapter(adapter);
myPager.setCurrentItem(0);

listButtonListener();

}

public void listButtonListener() {

listButton = (Button) findViewById(R.id.splashB);
listButton.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {

startActivity(new Intent("com.example.survtest1.Main"));

}

});

}

}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s