Hi everyone,
My code is as follows:
import com.raghavsood.mp.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
public class class extends Activity {
ImageView button = (ImageView)findViewById(R.id.l1m1);
private OnClickListener mCorkyListener = new OnClickListener() {
public void onClick(View v) {
button.setImageResource (R.drawable.m1s);
}
};
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Register the onClick listener with the implementation above
button.setOnClickListener(mCorkyListener);
}
}
My code had no problems when the parts in greenish color were not there. Now
the app force closes.
Please help. This is for a game I am making.
--
Raghav Sood
http://www.raghavsood.com/
http://www.androidappcheck.com/
http://www.telstop.tel/
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en