- 浏览: 1055856 次
- 性别:
- 来自: 南昌
文章分类
- 全部博客 (276)
- 生活 (1)
- 代码之美 (22)
- Media (7)
- Android Widget (3)
- Android Intent (1)
- Android Activity (4)
- UI event handle--UI事件处理机制 (2)
- Java基础知识 (12)
- android Databases (5)
- Android 系统知识 (70)
- 平常遇到的问题与解决方法 (38)
- Android TextView/EditView (2)
- Thinking Java (1)
- android webkit (6)
- JSON (1)
- XML (4)
- HTTP (1)
- Google Weather API (1)
- android 2.3 NFC (10)
- android app (20)
- android framework (7)
- C++ (2)
- android System (5)
- Pthread (1)
- Wifi (8)
- Unix/Linux C (8)
- Android 4.0 (1)
- Mail (1)
- Smack 源码学习 (4)
- iOS (4)
- Android (1)
- git (1)
- Gallery3d (2)
- React-Natice (1)
最新评论
-
dd18349182956:
你是用的smack哪个版本?我用的smack4.1.3和sma ...
关于socket长连接的心跳包 -
xukaiyin:
全英文
getApplicationContext()与this,getBaseContext() -
裂风矢:
...
<category android:name="android.intent.category.DEFAULT" /> 惹的祸 -
xanthodont:
mark一下
XMPP——Smack -
Evilover3:
mark一下,学习了
XMPP——Smack
今天在做项目的时候,用到百度地图的定位service.发现这样的一个奇怪现象,若是单独启动我的需要定位的Activity就能正确定位,若是与同事的代码整合就是整合到他的ActivityGroup里,则无法定位,通过查看logcat会看到以下的信息:
通过网上搜索解决方案,找到如下的解决方法
http://blog.csdn.net/tiandiren2007/article/details/7364936
在开发Android程序的过程中,在Activiti中调用bindService方法不成功,查看LogCat,发现有以下警告信息:
3-16 13:27:08.729: WARN/ActivityManager(66): Binding with unknown activity: android.os.BinderProxy@45087d60
如果出现了上面的警告信息,那么很有可能,你使用了一个ActivityGroup的子类,用来显示一些标签页。并且在标签页,也就是Activity中调用类似以下的代码:
bindService(intent, connection, Context.BIND_AUTO_CREATE);
查找了相关资料,似乎这是Android的一个bug,当在一个作为标签页显示的Activity中调用bindService方法就会出现这样的错误。
解决方法:
最简单的方法,将bindService改成getApplicationContext().bindService就可以了。
于是按照要求将mLocClient = new LocationClient(this);改成mLocClient = new LocationClient(getApplicationContext());则可以成功地启动定位的service进行定位。
不好意思,这么晚才回复您!你使用的baidu map sdk是哪个版本,我使用的是2.0.0的,还有你是否也使用了ActivityGroup?
05-09 12:05:40.710: W/ActivityManager(313): Bad activity token: android.os.BinderProxy@422c69d0 05-09 12:05:40.710: W/ActivityManager(313): java.lang.ClassCastException: android.os.BinderProxy cannot be cast to com.android.server.am.ActivityRecord$Token 05-09 12:05:40.710: W/ActivityManager(313): at com.android.server.am.ActivityRecord.forToken(ActivityRecord.java:269) 05-09 12:05:40.710: W/ActivityManager(313): at com.android.server.am.ActivityStack.isInStackLocked(ActivityStack.java:447) 05-09 12:05:40.710: W/ActivityManager(313): at com.android.server.am.ActivityManagerService.bindService(ActivityManagerService.java:11524) 05-09 12:05:40.710: W/ActivityManager(313): at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:681) 05-09 12:05:40.710: W/ActivityManager(313): at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:1565) 05-09 12:05:40.710: W/ActivityManager(313): at android.os.Binder.transact(Binder.java:297) 05-09 12:05:40.710: W/ActivityManager(313): at com.lbe.security.service.core.internal.d.onTransact(Unknown Source) 05-09 12:05:40.710: W/ActivityManager(313): at android.os.Binder.execTransact(Binder.java:338) 05-09 12:05:40.710: W/ActivityManager(313): at dalvik.system.NativeStart.run(Native Method) 05-09 12:05:40.710: W/ActivityManager(313): Binding with unknown activity: android.os.BinderProxy@422c69d0
通过网上搜索解决方案,找到如下的解决方法
http://blog.csdn.net/tiandiren2007/article/details/7364936
在开发Android程序的过程中,在Activiti中调用bindService方法不成功,查看LogCat,发现有以下警告信息:
3-16 13:27:08.729: WARN/ActivityManager(66): Binding with unknown activity: android.os.BinderProxy@45087d60
如果出现了上面的警告信息,那么很有可能,你使用了一个ActivityGroup的子类,用来显示一些标签页。并且在标签页,也就是Activity中调用类似以下的代码:
bindService(intent, connection, Context.BIND_AUTO_CREATE);
查找了相关资料,似乎这是Android的一个bug,当在一个作为标签页显示的Activity中调用bindService方法就会出现这样的错误。
解决方法:
最简单的方法,将bindService改成getApplicationContext().bindService就可以了。
于是按照要求将mLocClient = new LocationClient(this);改成mLocClient = new LocationClient(getApplicationContext());则可以成功地启动定位的service进行定位。
评论
2 楼
追求幸福
2013-12-16
minhphang 写道
我也遇到这个问题,按照你所说的方法修改了,还是不可以,同样的异常。
不好意思,这么晚才回复您!你使用的baidu map sdk是哪个版本,我使用的是2.0.0的,还有你是否也使用了ActivityGroup?
1 楼
minhphang
2013-11-26
我也遇到这个问题,按照你所说的方法修改了,还是不可以,同样的异常。
发表评论
-
Android Webview加载www.youtube.com的问题
2019-04-25 10:36 955Android Webview加载www.youtube.co ... -
EditText键盘删除字符的原理
2018-10-29 19:21 1197转https://blog.csdn.net/tankai19 ... -
Background execution not allowed
2018-10-22 19:02 327311-05 10:08:18.058 673 736 ... -
failed to set system property
2018-10-17 09:21 4164在App的mk文件设置了LOCAL_CERTIFICATE : ... -
CtsDeqpTestCases fail
2018-07-27 09:44 2908Suite / Plan:VTS / cts-on-gsi ... -
在DocumentUI中的Recent(最近)列表无法显示图片的缩略图
2018-06-12 18:23 905今天客户提了一个bug说在短信添加附件,界面无法显示缩略图。接 ... -
在任务栏中清除掉播放器的进程,状态栏仍有音乐播放器状态,且音乐仍在后台播放
2018-06-05 11:28 1547在任务栏中清除掉播放器的进程,状态栏仍有音乐播放器状态,且音乐 ... -
junit.framework.AssertionFailedError: Failed to get achievable frame rates for O
2018-05-25 15:41 2252之前对于CTS测试的失败case接触不多,组长突然转了这样一个 ... -
Android 模拟各种事件的方法
2018-05-17 16:30 1487有时候没有对应的硬件设备,那我们就得通过某种方式来模拟。比如模 ... -
Android Email 新建邮件时一直显示“waiting for sync”
2018-02-28 15:48 962当用户在Setting中清除了Email的data,再返回到E ... -
javax.net.ssl.SSLHandshakeException: Unacceptable certificate: CN=GeoTrust SSL C
2018-01-30 16:48 3635最近从Android N升级到Android O,发现163的 ... -
Email中附件名称中包含中文字符显示乱码
2017-11-28 17:09 1572Email中附件名称中包含中文字符显示乱码是因为附件虽包含了中 ... -
不能再通过createPackageContext来访问另外一个应用的资源(Sharepreference)
2017-11-14 17:22 1432以前我们可以通过createPackageContext来访问 ... -
当Email未设置账户时,通过ACTION_SENDTO启动会报ActivityNotFoundException
2017-09-27 18:15 504当Email未设置账户时,通过ACTION_SENDTO启动会 ... -
java.lang.SecurityException: Permission Denial: reading...requires android.permi
2016-05-12 11:12 2299一直在忙于Gallery,最近遇到了这样的bug,在Setti ... -
android.database.sqlite.SQLiteReadOnlyDatabaseException: attempt to write a read
2015-11-27 14:50 2910android.database.sqlite.SQLiteR ... -
AsyncTask
2015-08-21 17:43 382转自http://blog.csdn.net/hitlion2 ... -
解决IllegalStateException: Can not perform this action after onSaveInstanceState
2015-08-07 18:07 1047转自http://www.cnblogs.com/zgz345 ... -
Android setTag方法的key问题
2015-08-03 19:22 1029转自http://www.cnblogs.com/whitew ... -
ActivityGroup对子Activity的管理
2013-06-27 17:41 2070转自http://eyeandroid.diandian.co ...
相关推荐
Data Binding with Windows Forms 2.0: Programming Smart Client Data Applications with .NET By Brian Noyes ............................................... Publisher: Addison Wesley ...
基于ViewBinding,反射简单封装 Activity(ViewBinding,反射进行封装), Fragment(ViewBinding,反射进行封装), RecyclerView(多布局复用单个ViewHolder节省代码逻辑更清晰)
This book is all about the what and the why of binding to data sources in a Windows Forms application built using Visual Studio 2005. The book goes into great detail in explaining the rationale behind...
These tutorials describe how to map your classes to your tables manually (rather than with an automated tool like SqlMetal) so that you can have support for M:M relationships and data binding against ...
Data Binding with Windows Forms 2.0 Programming Smart Client Data Applications with .NET
Brian Noyes is a software architect, trainer, writer, and speaker with IDesign (www.idesign.net), a premier .NET architecture and design consulting and training company. He has been developing ...
Effect on influenza hemagglutinin protein binding with neutralizing antibody using terahertz spectroscopy technology
win32-ia-32-48_binding.node插件去掉node不报错win32-ia-32-48_binding.node插件去掉node不报错win32-ia-32-48_binding.node插件去掉node不报错win32-ia-32-48_binding.node插件去掉node不报错win32-ia-32-48_...
kotlin对activity和Fragment的简单封装,使得安卓开发越来越简洁。
主要介绍了C#应用BindingSource实现数据同步的方法,需要的朋友可以参考下
WPF的binding代码实例 总结的几个binding的基础运用
C# MVVM Binding demo
DTI预测领域的高被引lw,发表于2018年. ... One novel approach used in this work is the modeling of protein sequences and compound 1D representations with convolutional neural networks (CNNs).
RSS-XML Data-Binding to Data Control with Row Limitations。
wpf binding 的两种方法 数据库连接 并显示的两种方法
win32-x64-67_binding.node
使用beans-binding的经验和技巧
Cannot download linux-x64-72_binding.node/win32-x64-72_binding.node
BindingSource组件是数据源和控件间的一座桥,同时提供了大量的API和Event供我们使用。使用这些API我们可以将Code与各种具体类型数据源进行解耦;使用这些Event我们可以洞察数据的变化。...
linux-x64-64_binding.node资源