import android.app.Activity; import android.widget.*; import android.graphics.*; static void androidShowClickableImageAndText(final S imageID, final int borderColor, final Runnable onClick, final S text) { thread "showimg" { LinearLayout ll = new LinearLayout(androidContext()); ll.setOrientation(ll.VERTICAL); ImageView iv = new ImageView(androidContext()); iv.setBackgroundColor(borderColor); iv.setImageBitmap(BitmapFactory.decodeFile(loadLibrary(imageID).getPath())); if (onClick != null) iv.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { call(onClick); } }); ll.addView(iv); TextView tv = new TextView(androidContext()); tv.setText(text); ll.addView(tv); androidShow(ll); } }