view plain
package song.activity; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; public class SecondActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.second); Button bn2 = (Button)findViewById(R.id.button2); bn2.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(SecondActivity.this,ActivityTestActivity.class); startActivity(intent); } }); } }Android应用开发之Activity的简单布局切换(4)
内容版权声明:除非注明,否则皆为本站原创文章。