Hi
I'm a beginner developer for Android and I'm trying to write a very
simple application. What I'm trying to achieve is an activity composed
by a Bitmap and a virtual Keyboard. I've tried to show the keyboard in
the onCreate method of the activity and also in the constructor of the
View but without a positive result. At this point I suppose I don't
need to write a softKeyboard and the default one will be enought for
my purposes.
Thanks.
public class TC extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
engine mainWidget = new engine(this);
super.onCreate(savedInstanceState);
setContentView(mainWidget);
/*
InputMethodManager mgr = (InputMethodManager)
getSystemService(context.INPUT_METHOD_SERVICE);
mgr.showSoftInput(mainWidget, InputMethodManager.SHOW_FORCED);
*/
}
}
class engine extends View {
private Bitmap mBitmap;
private long mStartTime;
public engine(Context context) // Constructor...
{
super(context);
final int W = 200;
final int H = 200;
mBitmap = Bitmap.createBitmap(W, H, Bitmap.Config.RGB_565);
InputMethodManager mgr = (InputMethodManager)
context.getSystemService(context.INPUT_METHOD_SERVICE);
mgr.showSoftInput(this, InputMethodManager.SHOW_FORCED);
}
@Override protected void onDraw(Canvas canvas)
{
canvas.drawColor(0xFFCCCCCC);
// renderPlasma(mBitmap, System.currentTimeMillis() -
mStartTime);
canvas.drawBitmap(mBitmap, 0, 0, null);
// force a redraw, with a different time-based pattern.
invalidate();
}
}
--
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