What's new
DroidForums.net | Android Forum & News

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Android app help!!!

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:
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

}

});
}
}
 
Back
Top