Update views in one Activity from another

前端 未结 3 1573
渐次进展
渐次进展 2021-01-26 17:31

I am trying to emulate a software keyboard using an Activity with Theme.Dialog. The keyboard activity covers only part of the screen. The underlying activity is still active a

3条回答
  •  独厮守ぢ
    2021-01-26 18:16

    It will not work.. your Activity will be in paused state.. you try to invoke something there it sure will throw an Exception.. don't try it.. try onActivityResult() instead...

    :Edited

    well then try this..

    get the Activity instance (i mean the activity which has edit text) then

    if(!yourActviity.isFinishing())
    {
    
    ((EditText)yourActviity.findViewById(R.id.editText)).setText("text");
    }
    

提交回复
热议问题