Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Runtime Development

Reply
New Member
jcmoreno
Posts: 1
Registered: ‎12-05-2013
My Device: BB z10

Search button in keyboard doesn´t work Z10

Hi,

 

We are trying to call new fragment when the search button in keyboard is clicked, but there is no event when you push the button.

 

However, clicking an icon on the interface, that call the same code, works perfectly.

 

Could you tell us what could be the problem.

 

Below you can see the code we are using.

 

search.setOnEditorActionListener(new TextView.OnEditorActionListener() {

@Override

public boolean onEditorAction(TextView v, int actionId,

KeyEvent event) {

if (actionId == EditorInfo.IME_ACTION_SEARCH) {

 

setBackgroundOff(getListView());

switchActionBarName(getActivity()

.getString(R.string.search));

switchActionBarIcon(false);

 

String searcheEncoded = search.getText().toString()

.replace(" ", "%20");

switchFragment(new SearchFragment(searcheEncoded, api,

mLoader));

 

SCREEN_STATS = "Search";

hideKeyboard();

search.setText("");

returntrue;

}

returnfalse;

}

});

 

 

Thanks.

 

Best regards.

New Contributor
IgorHH
Posts: 6
Registered: ‎05-21-2013
My Device: Simulator bb10

Re: Search button in keyboard doesn´t work Z10

I have the same problem now :smileysad:

 

Can anyone help us?

New Contributor
IgorHH
Posts: 6
Registered: ‎05-21-2013
My Device: Simulator bb10

Re: Search button in keyboard doesn´t work Z10

Ok. As a solution to this issue i use the EditText in android without android:imeOptions="actionSearch" parameter. And put following in the listener:

 

if (actionId == EditorInfo.IME_ACTION_UNSPECIFIED)