I am trying to implement search in my android app. I have followed the step as suggested by the tutorials to make search possible. I have implemented search with a button.As soon as I press the button,not always but sometimes my Logcat show this error and application stops.This doesnot happen always but sometimes,I dont know why this happening as if this is an issue than the error should showup always when I click the search button.
01-07 13:32:54.759: E/AndroidRuntime(11826): FATAL EXCEPTION: main
01-07 13:32:54.759: E/AndroidRuntime(11826): java.lang.IllegalStateException: Could not execute method of the activity
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.view.View$1.onClick(View.java:3050)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.view.View.performClick(View.java:3517)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.view.View$PerformClick.run(View.java:14155)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.os.Handler.handleCallback(Handler.java:605)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.os.Handler.dispatchMessage(Handler.java:92)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.os.Looper.loop(Looper.java:137)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.app.ActivityThread.main(ActivityThread.java:4508)
01-07 13:32:54.759: E/AndroidRuntime(11826): at java.lang.reflect.Method.invokeNative(Native Method)
01-07 13:32:54.759: E/AndroidRuntime(11826): at java.lang.reflect.Method.invoke(Method.java:511)
01-07 13:32:54.759: E/AndroidRuntime(11826): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)
01-07 13:32:54.759: E/AndroidRuntime(11826): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
01-07 13:32:54.759: E/AndroidRuntime(11826): at dalvik.system.NativeStart.main(Native Method)
01-07 13:32:54.759: E/AndroidRuntime(11826): Caused by: java.lang.reflect.InvocationTargetException
01-07 13:32:54.759: E/AndroidRuntime(11826): at java.lang.reflect.Method.invokeNative(Native Method)
01-07 13:32:54.759: E/AndroidRuntime(11826): at java.lang.reflect.Method.invoke(Method.java:511)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.view.View$1.onClick(View.java:3045)
01-07 13:32:54.759: E/AndroidRuntime(11826): ... 11 more
01-07 13:32:54.759: E/AndroidRuntime(11826): Caused by: java.lang.OutOfMemoryError
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.graphics.Bitmap.nativeCreate(Native Method)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.graphics.Bitmap.createBitmap(Bitmap.java:605)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.graphics.Bitmap.createBitmap(Bitmap.java:551)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:437)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:543)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:518)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:370)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:773)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.content.res.Resources.loadDrawable(Resources.java:1935)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.content.res.Resources.getDrawable(Resources.java:664)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.app.ApplicationPackageManager.getDrawable(ApplicationPackageManager.java:580)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.content.pm.PackageItemInfo.loadIcon(PackageItemInfo.java:140)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.app.ApplicationPackageManager.getApplicationIcon(ApplicationPackageManager.java:637)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.app.SearchDialog.updateSearchAppIcon(SearchDialog.java:438)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.app.SearchDialog.updateUI(SearchDialog.java:391)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.app.SearchDialog.show(SearchDialog.java:278)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.app.SearchDialog.doShow(SearchDialog.java:230)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.app.SearchDialog.show(SearchDialog.java:212)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.app.SearchManager.startSearch(SearchManager.java:526)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.app.SearchManager.startSearch(SearchManager.java:503)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.app.Activity.startSearch(Activity.java:3055)
01-07 13:32:54.759: E/AndroidRuntime(11826): at android.app.Activity.onSearchRequested(Activity.java:3018)
01-07 13:32:54.759: E/AndroidRuntime(11826): at com.vahzay.android.smstrove.ListMessages.onsearchClick(ListMessages.java:150)
01-07 13:32:54.759: E/AndroidRuntime(11826): ... 14 more
Here is the snippet that cause this error
public void onsearchClick(View v) {
if (v.getId() == R.id.searcher) {
Log.i("search has been clicked", "show");
// this method is used to call the search activity from the
// listmessages activity no intent is used as its need a special
// functionality
onSearchRequested(); // line no 150
}
}
This crash happened due to Out of Memory Exception as given in your log. The search icon is not being loaded properly. For using Bitmaps efficiently take a look at this.
Related
This question already has answers here:
After Google Play Service update to version 13 I got an error
(8 answers)
Closed 8 years ago.
Hello i am traying to follow this tutorial
http://androidresearch.wordpress.com/2013/09/29/google-maps-api-v2-android-tutorial/
and i downloaded the source code but i cant get it run
this my debug logcat when i run the applicatino on the adv
01-07 19:12:44.086: I/dalvikvm(630): threadid=3: reacting to signal 3
01-07 19:12:44.106: I/dalvikvm(630): Wrote stack traces to '/data/anr/traces.txt'
01-07 19:12:51.036: I/Process(630): Sending signal. PID: 630 SIG: 9
01-07 19:15:28.196: I/dalvikvm(678): threadid=3: reacting to signal 3
01-07 19:15:28.296: I/dalvikvm(678): Wrote stack traces to '/data/anr/traces.txt'
01-07 19:15:28.466: D/AndroidRuntime(678): Shutting down VM
01-07 19:15:28.466: W/dalvikvm(678): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
01-07 19:15:28.486: E/AndroidRuntime(678): FATAL EXCEPTION: main
01-07 19:15:28.486: E/AndroidRuntime(678): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.mapsv2/com.example.mapsv2.MainActivity}: android.view.InflateException: Binary XML file line #1: Error inflating class fragment
01-07 19:15:28.486: E/AndroidRuntime(678): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
01-07 19:15:28.486: E/AndroidRuntime(678): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
01-07 19:15:28.486: E/AndroidRuntime(678): at android.app.ActivityThread.access$600(ActivityThread.java:123)
01-07 19:15:28.486: E/AndroidRuntime(678): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
01-07 19:15:28.486: E/AndroidRuntime(678): at android.os.Handler.dispatchMessage(Handler.java:99)
01-07 19:15:28.486: E/AndroidRuntime(678): at android.os.Looper.loop(Looper.java:137)
01-07 19:15:28.486: E/AndroidRuntime(678): at android.app.ActivityThread.main(ActivityThread.java:4424)
01-07 19:15:28.486: E/AndroidRuntime(678): at java.lang.reflect.Method.invokeNative(Native Method)
01-07 19:15:28.486: E/AndroidRuntime(678): at java.lang.reflect.Method.invoke(Method.java:511)
01-07 19:15:28.486: E/AndroidRuntime(678): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-07 19:15:28.486: E/AndroidRuntime(678): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-07 19:15:28.486: E/AndroidRuntime(678): at dalvik.system.NativeStart.main(Native Method)
01-07 19:15:28.486: E/AndroidRuntime(678): Caused by: android.view.InflateException: Binary XML file line #1: Error inflating class fragment
01-07 19:15:28.486: E/AndroidRuntime(678): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:697)
01-07 19:15:28.486: E/AndroidRuntime(678): at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
01-07 19:15:28.486: E/AndroidRuntime(678): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
01-07 19:15:28.486: E/AndroidRuntime(678): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
01-07 19:15:28.486: E/AndroidRuntime(678): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
01-07 19:15:28.486: E/AndroidRuntime(678): at android.app.Activity.setContentView(Activity.java:1835)
01-07 19:15:28.486: E/AndroidRuntime(678): at com.example.mapsv2.MainActivity.onCreate(MainActivity.java:13)
01-07 19:15:28.486: E/AndroidRuntime(678): at android.app.Activity.performCreate(Activity.java:4465)
01-07 19:15:28.486: E/AndroidRuntime(678): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
01-07 19:15:28.486: E/AndroidRuntime(678): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
01-07 19:15:28.486: E/AndroidRuntime(678): ... 11 more
01-07 19:15:28.486: E/AndroidRuntime(678): Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 4030500 but found 0. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
01-07 19:15:28.486: E/AndroidRuntime(678): at com.google.android.gms.common.GooglePlayServicesUtil.n(Unknown Source)
01-07 19:15:28.486: E/AndroidRuntime(678): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
01-07 19:15:28.486: E/AndroidRuntime(678): at com.google.android.gms.maps.internal.q.v(Unknown Source)
01-07 19:15:28.486: E/AndroidRuntime(678): at com.google.android.gms.maps.internal.q.u(Unknown Source)
01-07 19:15:28.486: E/AndroidRuntime(678): at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
01-07 19:15:28.486: E/AndroidRuntime(678): at com.google.android.gms.maps.SupportMapFragment$b.cE(Unknown Source)
01-07 19:15:28.486: E/AndroidRuntime(678): at com.google.android.gms.maps.SupportMapFragment$b.a(Unknown Source)
01-07 19:15:28.486: E/AndroidRuntime(678): at com.google.android.gms.dynamic.a.a(Unknown Source)
01-07 19:15:28.486: E/AndroidRuntime(678): at com.google.android.gms.dynamic.a.onInflate(Unknown Source)
01-07 19:15:28.486: E/AndroidRuntime(678): at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source)
01-07 19:15:28.486: E/AndroidRuntime(678): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:284)
01-07 19:15:28.486: E/AndroidRuntime(678): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:669)
01-07 19:15:28.486: E/AndroidRuntime(678): ... 20 more
01-07 19:15:28.706: I/dalvikvm(678): threadid=3: reacting to signal 3
01-07 19:15:28.726: I/dalvikvm(678): Wrote stack traces to '/data/anr/traces.txt'
01-07 19:15:29.106: I/dalvikvm(678): threadid=3: reacting to signal 3
01-07 19:15:29.126: I/dalvikvm(678): Wrote stack traces to '/data/anr/traces.txt'
01-07 19:15:36.495: I/Process(678): Sending signal. PID: 678 SIG: 9
and the xml code is here
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mapsv2"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyCyR3kVxyrriZlavRfsly-lBYo8Pl4VMkM" />
<activity
android:name="com.example.mapsv2.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
It's good habit to read error message first:
E/AndroidRuntime(678): Caused by: java.lang.IllegalStateException: The
meta-data tag in your app's AndroidManifest.xml does not have the
right value. Expected 4030500 but found 0. You must have the
following declaration within the element:
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
so add this to your manifest.
What can I do when I get an Exception but can't understand where to looking for
I mean I know it's in my NewHomeTabActivity, but where should I start searching. I try to insert some logs line and break point but still can't resolve the root cause
01-07 13:39:33.133: W/dalvikvm(12350): threadid=1: thread exiting with uncaught exception (group=0x40c471f8)
01-07 13:39:33.133: W/System.err(12350): java.lang.IllegalStateException: Could not find a method onTabClicked(View) in the activity class att.uc.ui.screen.NewHomeTabActivity for onClick handler on view class android.widget.RelativeLayout with id 'tab_dialer'
01-07 13:39:33.138: W/System.err(12350): at android.view.View$1.onClick(View.java:3085)
01-07 13:39:33.143: W/System.err(12350): at android.view.View.performClick(View.java:3620)
01-07 13:39:33.143: W/System.err(12350): at android.view.View$PerformClick.run(View.java:14292)
01-07 13:39:33.143: W/System.err(12350): at android.os.Handler.handleCallback(Handler.java:605)
01-07 13:39:33.148: W/System.err(12350): at android.os.Handler.dispatchMessage(Handler.java:92)
01-07 13:39:33.148: W/System.err(12350): at android.os.Looper.loop(Looper.java:137)
01-07 13:39:33.148: W/System.err(12350): at android.app.ActivityThread.main(ActivityThread.java:4507)
01-07 13:39:33.153: W/System.err(12350): at java.lang.reflect.Method.invokeNative(Native Method)
01-07 13:39:33.153: W/System.err(12350): at java.lang.reflect.Method.invoke(Method.java:511)
01-07 13:39:33.153: W/System.err(12350): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
01-07 13:39:33.158: W/System.err(12350): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
01-07 13:39:33.158: W/System.err(12350): at dalvik.system.NativeStart.main(Native Method)
01-07 13:39:33.158: W/System.err(12350): Caused by: java.lang.NoSuchMethodException: onTabClicked [class android.view.View]
01-07 13:39:33.163: W/System.err(12350): at java.lang.Class.getConstructorOrMethod(Class.java:460)
01-07 13:39:33.163: W/System.err(12350): at java.lang.Class.getMethod(Class.java:915)
01-07 13:39:33.168: W/System.err(12350): at android.view.View$1.onClick(View.java:3078)
01-07 13:39:33.173: W/System.err(12350): ... 11 more
Read the stactrace from bottom to up line by line to get the relevant message.
It crashes because it cannot find the method onTabClicked(View) in your activity.
I'm assuming that you have an XML control which is given the onClick property, something like this:
android:onClick="onTabClicked"
If so, then your activity should have a method called onTabClicked(View view) that accepts a parameter of type View, this is mandatory.
Like this:
public void onTabClicked(View view){
}
The log suggest it is a RunTimeException so you cannot find it by putting logs ,
the onTabClicked method you have used (maybe defined in xml file ) is not found at RunTime ,
this could be because you have called a higher sdk version while building against lower sdk version , you can either target higher sdk version or use alternative approach for onclick
similar link can suggest a possible solution Android TabWidget detect click on current tab
I am implementing socialAuth android in my application. But when i click my share button there is a error:
01-07 19:25:27.308: D/SocialAuthAdapter(4167): Selected provider is facebook
01-07 19:25:27.308: D/SocialAuthAdapter(4167): Loading keys and secrets from configuration
01-07 19:25:27.328: I/SocialAuthConfig(4167): Loading application configuration
01-07 19:25:27.358: I/OAuth2(4167): Determining URL for redirection
01-07 19:25:27.358: I/OAuth2(4167): Redirection to following URL should happen : https://graph.facebook.com/oauth/authorize?client_id=447809015285714&response_type=code&redirect_uri=fbconnect%3A%2F%2Fsuccess&scope=publish_stream,email,user_birthday,user_location
01-07 19:25:27.358: D/SocialAuthAdapter(4167): Loading URL : https://graph.facebook.com/oauth/authorize?client_id=447809015285714&response_type=code&redirect_uri=fbconnect%3A%2F%2Fsuccess&scope=publish_stream,email,user_birthday,user_location&type=user_agent&display=touch
01-07 19:25:27.358: D/SocialAuthAdapter(4167): Callback URI : fbconnect://success
01-07 19:25:27.368: W/ResourceType(4167): No package identifier when getting value for resource number 0x00000000
01-07 19:25:27.368: D/AndroidRuntime(4167): Shutting down VM
01-07 19:25:27.378: W/dalvikvm(4167): threadid=1: thread exiting with uncaught exception (group=0x40a9c210)
01-07 19:25:27.378: E/AndroidRuntime(4167): FATAL EXCEPTION: main
01-07 19:25:27.378: E/AndroidRuntime(4167): android.content.res.Resources$NotFoundException: Resource ID #0x0
01-07 19:25:27.378: E/AndroidRuntime(4167): at android.content.res.Resources.getValue(Resources.java:1023)
More log.
01-07 19:25:27.378: E/AndroidRuntime(4167): at android.content.res.Resources.getDrawable(Resources.java:668)
01-07 19:25:27.378: E/AndroidRuntime(4167): at org.brickred.socialauth.android.SocialAuthDialog.setUpTitle(SocialAuthDialog.java:149)
01-07 19:25:27.378: E/AndroidRuntime(4167): at org.brickred.socialauth.android.SocialAuthDialog.onCreate(SocialAuthDialog.java:123)
01-07 19:25:27.378: E/AndroidRuntime(4167): at android.app.Dialog.dispatchOnCreate(Dialog.java:353)
01-07 19:25:27.378: E/AndroidRuntime(4167): at android.app.Dialog.show(Dialog.java:257)
01-07 19:25:27.378: E/AndroidRuntime(4167): at org.brickred.socialauth.android.SocialAuthAdapter$3$1.run(SocialAuthAdapter.java:372)
01-07 19:25:27.378: E/AndroidRuntime(4167): at android.os.Handler.handleCallback(Handler.java:605)
01-07 19:25:27.378: E/AndroidRuntime(4167): at android.os.Handler.dispatchMessage(Handler.java:92)
01-07 19:25:27.378: E/AndroidRuntime(4167): at android.os.Looper.loop(Looper.java:137)
01-07 19:25:27.378: E/AndroidRuntime(4167): at android.app.ActivityThread.main(ActivityThread.java:4441)
01-07 19:25:27.378: E/AndroidRuntime(4167): at java.lang.reflect.Method.invokeNative(Native Method)
01-07 19:25:27.378: E/AndroidRuntime(4167): at java.lang.reflect.Method.invoke(Method.java:511)
01-07 19:25:27.378: E/AndroidRuntime(4167): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:823)
01-07 19:25:27.378: E/AndroidRuntime(4167): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:590)
01-07 19:25:27.378: E/AndroidRuntime(4167): at dalvik.system.NativeStart.main(Native Method)
And i have no idea why is that happening.
I have followed very carefully after examples.
Please put Icon for facebook,Google, twitter with name facebook.png,foursquare.png,google.png,linkedin.png,myspace.png,twitter.png,yahoo.png int res folder.
Just put on your Image (facebook.png , linkedin.png , twitter.png or many more who your integrate with your app) drawable folder.
This problem occur because on your lib file require icon and if its not here on your package then its shows error.
No package identifier when getting value for resource number 0x00000000
android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.Resources.getDrawable(Resources.java:668)
at org.brickred.socialauth.android.SocialAuthDialog.setUpTitle(SocialAuthDialog.java:149)
above i m just shown u main error which occur when file is not here on your drawable.
I'm trying to send a sms with chinese characters using SMSManager. It works fine for english and german, but unfortunately not for chinese.
My Log:
01-07 20:23:56.200: W/System.err(15742): java.lang.NullPointerException
01-07 20:23:56.200: W/System.err(15742): at android.os.Parcel.readException(Parcel.java:1266)
01-07 20:23:56.204: W/System.err(15742): at android.os.Parcel.readException(Parcel.java:1248)
01-07 20:23:56.204: W/System.err(15742): at com.android.internal.telephony.ISms$Stub$Proxy.sendText(ISms.java:561)
01-07 20:23:56.204: W/System.err(15742): at android.telephony.SmsManager.sendTextMessage(SmsManager.java:109)
01-07 20:23:56.204: W/System.err(15742): at com.app.myapp.MainActivity.sendSms(MainActivity.java:158)
01-07 20:23:56.204: W/System.err(15742): at com.app.myapp.MainActivity.buttonClick(MainActivity.java:103)
01-07 20:23:56.204: W/System.err(15742): at java.lang.reflect.Method.invokeNative(Native Method)
01-07 20:23:56.204: W/System.err(15742): at java.lang.reflect.Method.invoke(Method.java:521)
01-07 20:23:56.204: W/System.err(15742): at android.view.View$1.onClick(View.java:2067)
01-07 20:23:56.204: W/System.err(15742): at android.view.View.performClick(View.java:2408)
01-07 20:23:56.204: W/System.err(15742): at android.view.View$PerformClick.run(View.java:8818)
01-07 20:23:56.204: W/System.err(15742): at android.os.Handler.handleCallback(Handler.java:587)
01-07 20:23:56.204: W/System.err(15742): at android.os.Handler.dispatchMessage(Handler.java:92)
01-07 20:23:56.204: W/System.err(15742): at android.os.Looper.loop(Looper.java:123)
01-07 20:23:56.204: W/System.err(15742): at android.app.ActivityThread.main(ActivityThread.java:4627)
01-07 20:23:56.208: W/System.err(15742): at java.lang.reflect.Method.invokeNative(Native Method)
01-07 20:23:56.208: W/System.err(15742): at java.lang.reflect.Method.invoke(Method.java:521)
01-07 20:23:56.208: W/System.err(15742): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:871)
01-07 20:23:56.208: W/System.err(15742): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
01-07 20:23:56.208: W/System.err(15742): at dalvik.system.NativeStart.main(Native Method)
And this is how I send the SMS
SmsManager smsManager = SmsManager.getDefault();
for (int i = 0; i < numbers.size(); i++) {
smsManager.sendTextMessage(numbers.get(i), null,
message, null, null);
}
Any ideas? Thanks in advance.
I had the same problem, I could solved it just limiting the number of characters. In English, 160 characters are allowed. In Chinese, only 70 characters can be used (each character takes more bytes to be represented).
So, to test it, just replace message with message.substring(0, 69) and it will work.
To properly solve the proble, splitted messages must be sent, check:
http://www.programering.com/a/MTM4EjMwATE.html
I can't find following error in my code. It looks like the problem is in the asynctask onpostexecute.
java.lang.IllegalArgumentException: View not attached to window manager
at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:672)
at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:368)
at android.view.WindowManagerImpl$CompatModeWrapper.removeView(WindowManagerImpl.java:160)
at android.app.Dialog.dismissDialog(Dialog.java:319)
at android.app.Dialog.dismiss(Dialog.java:302)
at www.mobilezar.mn.Advertisements$InitialLoading.onPostExecute(Advertisements.java:216)
at www.mobilezar.mn.Advertisements$InitialLoading.onPostExecute(Advertisements.java:1)
at android.os.AsyncTask.finish(AsyncTask.java:631)
at android.os.AsyncTask.access$600(AsyncTask.java:177)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4898)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
at dalvik.system.NativeStart.main(Native Method)