Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ViewPostImeInputStage ACTION_DOWN

As I'm trying to debug my program, I can't figure out the error.

I have initialized two buttons and used .setOnClickListener on them. When the user clicks the buttons, they are supposed to see a debug message on LogCat. However, I keep seeing this message appear instead whenever I click the button, or if I click anywhere at all on the screen: ViewPostImeInputStage ACTION_DOWN.

Does anyone know what that message signifies, or if they a solution to my problem?

Thanks so much!

like image 582
bluexmarker Avatar asked Jun 21 '15 19:06

bluexmarker


2 Answers

ViewPostImeInputStage ACTION_DOWN is a bug that occurs stemming from the rare instance where your layout is rejected and you are no longer able to click on any clickable items, and what occurs instead is a ViewPostImeInputStage ACTION_DOWN with every button press (and no action). The solution for this is simple, wrap your layout content with a parent. So if you xml format was

<LinearLayout <---root layout
...
<!-- your content -->
</LinearLayout> <-- root layout end

change to

<FrameLayout <---root layout
   <LinearLayout <-- parent wrap start
   ...
<!-- your content -->
   </LinearLayout> <-- parent wrap end
</FrameLayout> <-- root layout end

This solution should resolve that conflict. Atleast this is what has worked for me. Cheers!

like image 123
portfoliobuilder Avatar answered Sep 28 '22 06:09

portfoliobuilder


I got the same problem as yours,and I tried portfoliobuilder's way but it didn't work. And then I just make some changes on my code,then it worked. I just set every instance of my button an OnlickListener interface instead of letting my Class inplements the View.OnClickListener~

button.setOnclickListener(new View.OnClickListener){
public void onClick(View v){//...
}
}

INSTEAD OF

public YourClass implements View.OnClickListener{...
public void OnClick(View v){
switch(v.getId()){
case://...
break;}}}
like image 43
Dong Little Avatar answered Sep 28 '22 07:09

Dong Little