I am also stuck at this age ...
Intent intent = new Intent(Intent.ACTION_MAIN); intent.setComponent(newComponentName("com.google.android.voicesearch","com.google.android.voicesearch.VoiceSearchPreferences")); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); this.startActivity(intent); }
Hope this is for you too ...
EDIT: As stated in the comments, this has changed in the Jelly Bean version of the Google Search application. To catch any possible upgrade issues when you cannot use Build.Version, you can use something in these lines:
try { final Intent vsInt = new Intent(Intent.ACTION_MAIN); vsInt.setComponent(new ComponentName("com.google.android.voicesearch", "com.google.android.voicesearch.VoiceSearchPreferences")); vsInt.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); ctx.startActivity(vsInt); } catch (final Exception e) { try { final Intent vsjInt = new Intent(Intent.ACTION_MAIN); vsjInt.setComponent(new ComponentName("com.google.android.googlequicksearchbox", "com.google.android.voicesearch.VoiceSearchPreferences")); vsjInt.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); ctx.startActivity(vsjInt); } catch (final Exception e1) { e1.printStackTrace(); } }
source share