Ah lol, I didn't see that. Sorry!

I can't seem to find a nice way to do this, but this seems to work:

            EditText text = FindViewById<EditText>(Resource.Id.MyTextView);

            ThreadPool.QueueUserWorkItem((s) =>
            {
                Thread.Sleep(100);
                RunOnUiThread(() =>
                    {
                        text.RequestFocus();

text.DispatchTouchEvent(MotionEvent.Obtain(SystemClock.UptimeMillis(),
SystemClock.UptimeMillis(), MotionEventActions.Down, 0, 0, 0));

text.DispatchTouchEvent(MotionEvent.Obtain(SystemClock.UptimeMillis(),
SystemClock.UptimeMillis(), MotionEventActions.Up, 0, 0, 0));
                    });
            });

This is done in the OnCreate method of the activity. What happens is
that I request focus on the EditText and simulate a tap on it. There
is probably a really nice way of doing it otherwise!

On Mon, Apr 23, 2012 at 3:00 PM, Miljenko Cvjetko
<[email protected]> wrote:
> Hi Tomasz
>
>
> On 2012.04.23 14:58, Tomasz Cielecki wrote:
>>
>> Use UITextFields BecomeFirstResponder() method.
>>
>> I.e.:
>>
>> UITextField _textField = new UITextField();
>> _textField.BecomeFirstResponder();
>> View.AddSubview(_textField);
>
> Yup, we are both on m4a and mtch lists, but this time I was asking about
> m4a and You just gave me sample for mtch.
>
> but anyway thanks
>
> mel
>
>
>>
>> On Mon, Apr 23, 2012 at 2:24 PM, Miljenko Cvjetko
>> <[email protected]>  wrote:
>>>
>>> Hi
>>>
>>> I have single edittext widget in activity layout and would like to show
>>> keyboard without
>>> user interaction when activity loads.
>>>
>>> This is what I have tried:
>>> editText1.RequestFocus();
>>> editText1.RequestFocusFromTouch() ;
>>> editText1.PerformClick();
>>>
>>> but keyboard shows (in emulator) only if user clicks/touches edittext
>>> control
>>>
>>> thanks + regards
>>>
>>> mel
>>>
>>> --
>>> Miljenko Cvjetko dipl.ing. ET
>>>        Direktor/CEO
>>>        Projektant rješenja/Solution Architect
>>>        Razvojni programer/Senior developer
>>>        Voditelj projekta/Project Manager
>>>
>>> IX južna obala 13
>>> Kajzerica Zagreb
>>> T: 385 1 7775555
>>> M: 385 91 557 447 3
>>> F: 385 1 7779556
>>> e: [email protected]
>>> w: http://www.holisticware.net
>>>
>>> _______________________________________________
>>> Monodroid mailing list
>>> [email protected]
>>>
>>> UNSUBSCRIBE INFORMATION:
>>> http://lists.ximian.com/mailman/listinfo/monodroid
>>
>>
>>
>
>
> --
> Miljenko Cvjetko dipl.ing. ET
>        Direktor/CEO
>        Projektant rješenja/Solution Architect
>        Razvojni programer/Senior developer
>        Voditelj projekta/Project Manager
>
> IX južna obala 13
> Kajzerica Zagreb
> T: 385 1 7775555
> M: 385 91 557 447 3
> F: 385 1 7779556
> e: [email protected]
> w: http://www.holisticware.net
>



-- 
Med Venlig Hilsen / With Best Regards
Tomasz Cielecki
http://ostebaronen.dk
_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to