Note that there are some explanatory texts on larger screens.

plurals
  1. POError While searching Message app
    text
    copied!<p>I am getting the error while sending intent with the follling action Intent.ACTION_SEARCH. </p> <pre><code>private void showMessagingSearch(Resources resources) { View v; ImageView appimage; v = getLayoutInflater().inflate(R.layout.app_label_item, null); TextView appName = (TextView) v.findViewById(R.id.app_name); appName.setText("Messaging Search"); appimage = (ImageView) v.findViewById(R.id.app_image); /* * Bitmap messagingSearchBitmap = * BitmapFactory.decodeResource(resources, * R.drawable.messaging_tushar_search); * appimage.setImageBitmap(messagingSearchBitmap); */ appimage.setImageResource(R.drawable.messaging_search); appimage.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { saveDatatoFile(MESSAGING_SEARCH); if (!TextUtils.isEmpty(mText)) { Intent intent = new Intent(Intent.ACTION_SEARCH); intent.setPackage("com.android.sms"); intent.putExtra("query", mText); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); finish(); } } }); mParent.addView(v); } </code></pre> <p>When clicking on the imageButton(when onClick is called) , Its giving following error :</p> <pre><code>08-03 14:55:28.045: E/AndroidRuntime(28170): FATAL EXCEPTION: main 08-03 14:55:28.045: E/AndroidRuntime(28170): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.SEARCH flg=0x10000000 pkg=com.android.sms (has extras) } 08-03 14:55:28.045: E/AndroidRuntime(28170): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1545) 08-03 14:55:28.045: E/AndroidRuntime(28170): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1416) 08-03 14:55:28.045: E/AndroidRuntime(28170): at android.app.Activity.startActivityForResult(Activity.java:3389) 08-03 14:55:28.045: E/AndroidRuntime(28170): at android.app.Activity.startActivityForResult(Activity.java:3350) 08-03 14:55:28.045: E/AndroidRuntime(28170): at android.app.Activity.startActivity(Activity.java:3562) 08-03 14:55:28.045: E/AndroidRuntime(28170): at android.app.Activity.startActivity(Activity.java:3528) 08-03 14:55:28.045: E/AndroidRuntime(28170): at com.example.smartlauncher.DataDrivenAcitivity$7.onClick(DataDrivenAcitivity.java:718) 08-03 14:55:28.045: E/AndroidRuntime(28170): at android.view.View.performClick(View.java:4091) 08-03 14:55:28.045: E/AndroidRuntime(28170): at android.view.View$PerformClick.run(View.java:17036) 08-03 14:55:28.045: E/AndroidRuntime(28170): at android.os.Handler.handleCallback(Handler.java:615) 08-03 14:55:28.045: E/AndroidRuntime(28170): at android.os.Handler.dispatchMessage(Handler.java:92) 08-03 14:55:28.045: E/AndroidRuntime(28170): at android.os.Looper.loop(Looper.java:137) 08-03 14:55:28.045: E/AndroidRuntime(28170): at android.app.ActivityThread.main(ActivityThread.java:4922) 08-03 14:55:28.045: E/AndroidRuntime(28170): at java.lang.reflect.Method.invokeNative(Native Method) 08-03 14:55:28.045: E/AndroidRuntime(28170): at java.lang.reflect.Method.invoke(Method.java:511) 08-03 14:55:28.045: E/AndroidRuntime(28170): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792) 08-03 14:55:28.045: E/AndroidRuntime(28170): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555) 08-03 14:55:28.045: E/AndroidRuntime(28170): at dalvik.system.NativeStart.main(Native Method) </code></pre> <p>Following is the permission i mentioned in the manifest:</p> <pre><code>&lt;uses-permission android:name="android.permission.READ_SMS" /&gt; Manifest File: &lt;uses-sdk android:minSdkVersion="4" android:targetSdkVersion="12" /&gt; &lt;supports-screens android:largeScreens="false" android:normalScreens="true" android:smallScreens="false" /&gt; &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt; &lt;uses-permission android:name="android.permission.GET_TASKS" /&gt; &lt;uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" /&gt; &lt;uses-permission android:name="android.permission.READ_CONTACTS" /&gt; &lt;uses-permission android:name="android.permission.CALL_PHONE" /&gt; &lt;uses-permission android:name="android.permission.READ_SMS" /&gt; &lt;application android:allowBackup="true" android:icon="@drawable/magic_slate" android:label="@string/app_name" &gt; &lt;activity android:name="com.example.magicslate.AppSwitch" android:label="@string/app_name" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name="com.example.magicslate.Launch" android:label="@string/app_name" android:theme="@style/Theme.Transparent" /&gt; &lt;activity android:name="com.example.smartlauncher.DataDrivenAcitivity" android:configChanges="orientation|keyboardHidden|screenSize" android:excludeFromRecents="true" android:label="@string/app_name" android:launchMode="singleInstance" android:screenOrientation="portrait" android:theme="@android:style/Theme.Holo.Wallpaper.NoTitleBar" android:windowSoftInputMode="stateVisible" /&gt; &lt;activity android:name="com.example.applaunch.GestureBuilderActivity" android:icon="@drawable/ic_gesturebuilder" android:label="@string/application_name" /&gt; &lt;activity android:name="com.example.applaunch.CreateGestureActivity" android:label="@string/label_create_gesture" /&gt; &lt;service android:name="com.example.magicslate.MainService" /&gt; &lt;receiver android:name="LongPressReceiver" &gt; &lt;intent-filter&gt; &lt;action android:name="com.android.magicslate.broadcast" &gt; &lt;/action&gt; &lt;/intent-filter&gt; &lt;/receiver&gt; &lt;/application&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload