0

So basically I have an Activity with a layout that shows my custom SurfaceView and an invisible EditText.

How can I call setVisibility(VISIBLE) on that object? I do use post(Runnable...) on my SurfaceView object, but the problem is findViewById(my EditText id) returns null?

I found why but how do I solve it?

Also, how do I recive a callback from the "Done" button on the EditText? Is it the same as the enter key?

Community
  • 1
  • 1
Aron
  • 144
  • 2
  • 11

1 Answers1

0

You need to search for id.content on the view that has it as a child. So use the following:

TextView t = (TextView) getParent().findViewById(R.id.contents);

To answer your other question, to find when the user hits the enter key, use

t.setOnEditorActionListener(...)
Kyle
  • 611
  • 4
  • 6