smithmanny
New Member
I am trying to make my image button clickable and send it to another screen so it can display info. Can someone help me with the code?!
Here is my code:
Here is my code:
package com.member.ofwgkta;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
public class MainActivity extends Activity {
private ImageButton domoButton;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
domoButton = (ImageButton) findViewById(R.id.domo);
domoButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(home.this, Activity2.class);
startActivity(intent);
// TODO Auto-generated method stub
}
});
}
}