Cant get the android soft keyboard to appear/hide using viewpager?

I have found that using the wrong context screws up things usually. Try this Override public Object instantiateItem( View collection, int position ) { LayoutInflater inflator = (LayoutInflater) collection.getContext(). GetSystemService(Context.

LAYOUT_INFLATER_SERVICE); View layout = null; if(position==0){ layout=inflater. Inflate(R.layout. Other, null); //new PC().

Create(layout, context); ((InputMethodManager)collection.getContext(). GetSystemService(Context. INPUT_METHOD_SERVICE)).

DeSoftInputFromWindow(collection.getWindowToken(), 0); }else if(position==1){ layout=inflater. Inflate(R.layout. Main, null); new BlurayRemote().

Create(layout, collection.getContext()); ((InputMethodManager)collection.getContext(). GetSystemService(Context. INPUT_METHOD_SERVICE)).

DeSoftInputFromWindow(collection.getWindowToken(), 0); }else if(position==2){ layout=inflater. Inflate(R.layout. Text, null); new TextInput().

Create(layout,collection.getContext()); ((InputMethodManager)collection.getContext(). GetSystemService(Context. INPUT_METHOD_SERVICE)).

ShowSoftInputFromInputMethod(collection.getWindowToken(), 0); } ((ViewPager) collection). AddView(layout); return layout; }.

I have found that using the wrong context screws up things usually. Try this. @Override public Object instantiateItem( View collection, int position ) { LayoutInflater inflator = (LayoutInflater) collection.getContext().

GetSystemService(Context. LAYOUT_INFLATER_SERVICE); View layout = null; if(position==0){ layout=inflater. Inflate(R.layout.

Other, null); //new PC(). Create(layout, context); ((InputMethodManager)collection.getContext(). GetSystemService(Context.

INPUT_METHOD_SERVICE)). DeSoftInputFromWindow(collection.getWindowToken(), 0); }else if(position==1){ layout=inflater. Inflate(R.layout.

Main, null); new BlurayRemote(). Create(layout, collection.getContext()); ((InputMethodManager)collection.getContext(). GetSystemService(Context.

INPUT_METHOD_SERVICE)). DeSoftInputFromWindow(collection.getWindowToken(), 0); }else if(position==2){ layout=inflater. Inflate(R.layout.

Text, null); new TextInput(). Create(layout,collection.getContext()); ((InputMethodManager)collection.getContext(). GetSystemService(Context.

INPUT_METHOD_SERVICE)). ShowSoftInputFromInputMethod(collection.getWindowToken(), 0); } ((ViewPager) collection). AddView(layout); return layout; }.

This works the first time but after a bit does not work any more. Any idea why? – smee204 Oct 22 at 16:54.

In my application I am using viewPager to give me nice swipey views. I want the keyboard to be hidden in 2 of the pages but always diaplayed on one page, where I have a text box. I have tried various ways to get the keyboard to display but it just does not work.

I think I must be calling the display keyboard code in the wrong place. Any help would be great as it is driving me mad!

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions