I have an issue in my Android Tablet app (7 inch tablet) where I need to tap any View twice in order for the click event or focus event to fire. When I say any view I mean : (ImageView, EditText, Spinner or any Custom view (i.e: a RelativeLayout with child views )) . After having to initially tap twice-- the click event then seems more responsive. But then going to the next Activity the same issue arises. I have seen solutions where you use Touch Events instead or Listen for a focus event in addition to the click event then call performClick() but none of these have worked and just seems like Band Aides and are not getting to the root of the issue . I need an all encompassing solution here for all views in all my Activities. I'm on Android 4.2.2 using SDK 16. Also it doesn't matter if the event concerns a root layout or child View.
UPDATE (1-30-2015): I believe the issue has to do with the navigation bar or "soft buttons" . I hide this always by default to gain real estate. However, if I swipe up to reveal the navigation bar, then tap one of my view it will fire the click event reliably. So how can I hide the navigation bar AND have my click event fire reliably? Hmmmm.....
Sample view that does not receive a click event reliably:
<ImageView
android:id="@+id/img_ts_logo"
android:layout_width="@dimen/app_icon_width"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/app_icon_margin"
android:layout_marginRight="@dimen/app_icon_margin"
android:src="@drawable/logo_notext"/>
private View.OnClickListener logoListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setClassName("com.android.settings", "com.android.settings.LanguageSettings");
startActivity(intent);
}
};