At first ... I had a Imageview in my XML file layout but then I changed my opinion and delete the Imageview and put an ImageButton in it.
So far so good
The Problem occurs that the onclick method of the ImageView doesn't work with the ImageButton :(
But I don't know why
Here ist my XML Piece of the ImageButton
<
ImageButton
android:id="@+id/LPic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="centerInside"
android:src="@drawable/t189"
android:onClick="onButtonClick" ***
I marked the line with three stars - if I delete the line - the app worked - but no click Action anyway
If I put it back - eclipse says nullpointerexeption couldn't not execute method of the activity - onclick
My onbuttonclick method stays the same as with the Imageview
public void onButtonClick (View view){
bla bla bla ..}
Inside I changed the pic of the ImageButton with
ImageButton LPic = (ImageButton)findViewById(R.id.LPic);
String Path = SavePath.toString()+"/"+PicFiles[ZL];
Drawable d = Drawable.createFromPath(Path);
LPic.setImageDrawable(d);