EditText in Android doesn't show text when typing while using the on-screen keyboard

后端 未结 3 1177
温柔的废话
温柔的废话 2020-12-11 07:34

I have an activity consisting of 3 EditText fields (amongst other things like TextViews and a few buttons). I also have an AutoCompleteTextView with a list of String\'s usin

3条回答
  •  爱一瞬间的悲伤
    2020-12-11 08:34

    Ok, so I worked out what the issue was!

    The code which I didn't post because I thought it was 'irrelevant' contained a thread

    public static Runnable updateTimerMethod = new Runnable() 
    {
    
        public void run() 
        {
            sessionTimer.setText(TimerHandler.theTime);  
    
            myHandler.postDelayed(this, 0);
    
        }
     }; 
    

    I realised that the thread was basically taking up all of the activity (I don't really know how to explain that properly) by having the postDelayed as 0. Once I changed this to say... 100, then the EditText worked.

    Thank you to @NKN who helped me.

    This may be specific to me, but hopefully this will help somebody else.

提交回复
热议问题