Back to project page introToDroid4ed.
The source code is released under:
GNU General Public License
If you think the Android project introToDroid4ed listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.introtoandroid.viewsamples; /* www .j a v a 2 s. c o m*/ import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ImageSwitcher; import android.widget.Toast; public class ContainersActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.containers); Button switch_button = (Button)findViewById(R.id.flip_button); final ImageSwitcher switcher = (ImageSwitcher) findViewById(R.id.img_switch); switch_button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Toast.makeText(ContainersActivity.this, "Switching", Toast.LENGTH_SHORT).show(); switcher.showNext(); } }); } }