Am working on an educational software that is supposed to determine users pronounciation of selected words from a list box is correct or wrong. my probem is that, any word chosen is always correct, even though i clicked a wrong option.
Any help??
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Logesh PalaniRank #274 · 9.1K reputationPosted Aug 18, 2018, 6:48 AM EDT
Class members in MainActivity
Start service in
onCreate()@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent service = new Intent(activityContext, VoiceCommandService.class); activityContext.startService(service); mBindFlag = Build.VERSION.SDK_INT Build.VERSION_CODES.ICE_CREAM_SANDWICH ? 0 : Context.BIND_ABOVE_CLIENT; }Bind service in
onStart()@Override protected void onStart() { super.onStart(); bindService(new Intent(this, VoiceCommandService.class), mServiceConnection, mBindFlag); } @Override protected void onStop() { super.onStop(); if (mServiceMessenger != null) { unbindService(mServiceConnection); mServiceMessenger = null; } }mServiceConnectionmemberif (DEBUG) {Log.d(TAG, "onServiceConnected");} //$NON-NLS-1$ mServiceMessenger = new Messenger(service); Message msg = new Message(); msg.what = VoiceCommandService.MSG_RECOGNIZER_START_LISTENING; try { mServiceMessenger.send(msg); } catch (RemoteException e) { e.printStackTrace(); } } @Override public void onServiceDisconnected(ComponentName name) { if (DEBUG) {Log.d(TAG, "onServiceDisconnected");} //$NON-NLS-1$ mServiceMessenger = null; } }; // mServiceConnectionIn the service
@Override public IBinder onBind(Intent intent) { Log.d(TAG, "onBind"); //$NON-NLS-1$ return mServerMessenger.getBinder(); }