1
edit
Changes
→3. Add Elements on Main (First) Screen
_keywordFilterField = new KeywordFilterField();
_keywordFilterField.setSourceList(_studentList, _studentList);
_mainScreen.setTitle(_keywordFilterField.getKeywordField());
_mainScreen.add(_keywordFilterField);
</source>
3.9. Add background to the ''keywordFilterField'':
<source lang="java">
// Attempt to load a bitmap background
try
{
Background bitmapBackground = BackgroundFactory.createBitmapBackground(Bitmap.getBitmapResource("background.png"),
Background.POSITION_X_CENTER, Background.POSITION_Y_CENTER, Background.REPEAT_BOTH);
_keywordFilterField.setBackground(bitmapBackground);
}
catch (final IllegalArgumentException e)
{
UiApplication.getUiApplication().invokeLater(new Runnable() {
public void run() {
Dialog.alert(e.toString());
}
});
}
</source>
3.8. Add inner class for custom search field: