该怎么做就TransactionToosegment too largeeException

经验241 米
在线时间33 小时
积分 282, 距离下一级还需 218 积分
积分 282, 距离下一级还需 218 积分
机型小米手机1/1S
签到次数13
最近小米手机的启动器老是不断地跳出来,点了 确定 还是不断地出现,这是在没有无线网络和数据的情况下出现的,而把数据开了一会就没问题了。因为起初是在进行桌面图标和小部件排列时出现的,刚开始没在意就重启了下,可是没一会问题又出现了,于是索性刷了一下,当把以前的数据恢复好之后问题依旧,这让我很是纠结,到现在已经刷了好多次,但是一恢复数据问题还是有,把那个错误信息发送给小米好多次,但是一直没有回应,所以今天才特别来发个求助贴,希望小米官方工程师能看到帮忙一下,也请民间高手能提供一些帮助,在此不胜感激!下面把错误信息发一下,我想对解决问题会有帮助。& &
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.miui.home/com.miui.home.launcher.Launcher}: java.lang.RuntimeException: system server dead?
& && &&&at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1969)
& && &&&at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1994)
& && &&&at android.app.ActivityThread.access$600(ActivityThread.java:126)
& && &&&at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1150)
& && &&&at android.os.Handler.dispatchMessage(Handler.java:99)
& && &&&at android.os.Looper.loop(Looper.java:137)
& && &&&at android.app.ActivityThread.main(ActivityThread.java:4439)
& && &&&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:787)
& && &&&at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
& && &&&at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: system server dead?
& && &&&at android.appwidget.AppWidgetHost.startListening(AppWidgetHost.java:133)
& && &&&at com.miui.home.launcher.Launcher.onStart(Launcher.java:546)
& && &&&at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1133)
& && &&&at android.app.Activity.performStart(Activity.java:4481)
& && &&&at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1942)
& && &&&... 11 more
Caused by: android.os.TransactionTooLargeException
& && &&&at android.os.BinderProxy.transact(Native Method)
& && &&&at com.android.internal.appwidget.IAppWidgetService$Stub$Proxy.startListening(IAppWidgetService.java:310)
& && &&&at android.appwidget.AppWidgetHost.startListening(AppWidgetHost.java:130)
& && &&&... 15 more
分享到微信朋友圈
打开微信,点击底部的“发现”,使用 “扫一扫” 即可将网页分享到我的朋友圈。
经验528 米
在线时间89 小时
版本6.3.10
机型小米手机2/2S
签到次数19
MIUI版本6.3.10
这个我们正在处理中,解决后我再告诉你。
经验2198 米
在线时间164 小时
版本5.3.20
积分 3226, 距离下一级还需 1774 积分
积分 3226, 距离下一级还需 1774 积分
机型小米手机3/4 WCDMA版
签到次数47
MIUI版本5.3.20
支持 顶一下
经验241 米
在线时间33 小时
积分 282, 距离下一级还需 218 积分
积分 282, 距离下一级还需 218 积分
机型小米手机1/1S
签到次数13
终于有回复了,等了好久啊,希望快些解决。
经验66249 米
威望985 米
在线时间1863 小时
版本6.3.22
一个人走了太久,久到我已经习惯一个人
机型小米手机3/4 WCDMA版
签到次数158
MIUI版本6.3.22
有老大在,我是来凑热闹的
经验528 米
在线时间89 小时
版本6.3.10
机型小米手机2/2S
签到次数19
MIUI版本6.3.10
这个问题已经解决了,感谢支持!刷下个版本吧。
经验3998 米
在线时间302 小时
版本5.10.12
积分 4672, 距离下一级还需 328 积分
积分 4672, 距离下一级还需 328 积分
机型红米Note2 移动/标准
签到次数122
MIUI版本5.10.12
我帮你顶起来
谁也不能阻挡酱油党的脚步了,入我酱门者,可感悟酱之大道,修酱之本源,凝酱之真身,成酱之真神,天上地下唯酱独尊,唯酱不灭,为酱之荣耀,我辈酱士何惜一战,酱定胜天,复我酱之无上辉煌!现在请举起你的右手,跟着我读入党宣言我志愿加入全国酱油党,成为一名光荣的
在线时间1 小时
版本JMACNAH1.0
积分 30, 距离下一级还需 20 积分
积分 30, 距离下一级还需 20 积分
机型小米手机1/1S
MIUI版本JMACNAH1.0
想问一下大神,是怎么解决的呢~~求分享阿~~是widget在加载图片的时候超过了buffer的limit 值吗?
读书,旅行,运动,做最好的自己
经验528 米
在线时间89 小时
版本6.3.10
机型小米手机2/2S
签到次数19
MIUI版本6.3.10
是其他人解决的,我也不清楚细节,不好意思
1000万用户纪念勋章
MIUI1000万用户纪念勋章
关注腾讯微博
已关注腾讯微博
关注新浪微博
已关注新浪微博
MIUI 3000万
MIUI 3000万发烧友纪念勋章
MIUI 2000万
MIUI 2000万发烧友纪念勋章
MIUI 7纪念勋章
解答组专属勋章
解答组专属勋章
MIUI五周年
MIUI五周年纪念勋章
小米手机3终身荣誉勋章
小米手机3终身荣誉勋章
MIUI三周年
MIUI三周年纪念勋章
百万壁纸评审纪念勋章
已关注极客秀微信
已关注微信
疾风测评勋章
资源疾行活动限定勋章
MIUI6 荣誉勋章
MIUI6 荣誉勋章
应用达人勋章
MIUI俱乐部发烧友
MIUI俱乐部发烧友
Copyright (C) 2016 MIUI
京ICP备号 | 京公网安备34号 | 京ICP证110507号1)CrashDB表
CREATE TABLE [dbo].[CrashDB](
[id] [float] NULL,
[device_type] [float] NULL,
[client_type] [float] NULL,
[page_name] [nvarchar](255) NULL,
[exception_name] [nvarchar](255) NULL,
[crash_type] [float] NULL,
[app_version] [nvarchar](255) NULL,
[os_version] [nvarchar](255) NULL,
[device_model] [nvarchar](255) NULL,
[device_id] [nvarchar](255) NULL,
[network_type] [float] NULL,
[partner] [float] NULL,
[memory_info] [nvarchar](255) NULL,
[crash_time] [nvarchar](255) NULL,
[exception_stack] [nvarchar](max) NULL,
) ON [PRIMARY]
2)CrshDB表(最终版,多两个字段)
CREATE TABLE [dbo].[CrashDB](
[id] [float] NULL,
[device_type] [float] NULL,
[client_type] [float] NULL,
[page_name] [nvarchar](255) NULL,
[exception_name] [nvarchar](255) NULL,
[crash_type] [float] NULL,
[app_version] [nvarchar](255) NULL,
[os_version] [nvarchar](255) NULL,
[device_model] [nvarchar](255) NULL,
[device_id] [nvarchar](255) NULL,
[network_type] [float] NULL,
[partner] [float] NULL,
[memory_info] [nvarchar](255) NULL,
[crash_time] [nvarchar](255) NULL,
[exception_stack] [nvarchar](max) NULL,
[crash_desc] [nvarchar](255) NULL,
[dis_info] [nvarchar](max) NULL,
[crash_category_id] [int] NULL
) ON [PRIMARY]
3)CrashStore表
CREATE TABLE [dbo].[CrashStore](
[categoty_id] [int] IDENTITY(1,1) NOT NULL,
[page_name] [nvarchar](255) NULL,
[sub_crash_desc] [nvarchar](500) NULL,
[sub_crash_length] [int] NULL,
[app_version] [nvarchar](50) NULL,
[fix_status] [nchar](10) NULL,
[first_find_date] [datetime] NULL,
CONSTRAINT [PK_CrashStore] PRIMARY KEY CLUSTERED
[categoty_id] ASC
)WITH (PAD_INDEX
= OFF, STATISTICS_NORECOMPUTE
= OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS
= ON, ALLOW_PAGE_LOCKS
= ON) ON [PRIMARY]
) ON [PRIMARY]
ALTER TABLE [dbo].[CrashStore] ADD
CONSTRAINT [DF_CrashStore_first_find_date]
DEFAULT (getdate()) FOR [first_find_date]
4)UpdateCrashDesc存储过程
CREATE PROCEDURE [dbo].[UpdateCrashDesc]
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
update CrashDB
set crash_desc = '内存溢出'
where exception_stack like '%OutOfMemory%'
and crash_desc is null
update CrashDB
set crash_desc = 'ClassCastException'
where crash_desc is null
and exception_stack like '%java.lang.ClassCastException%'
update CrashDB
set crash_desc = '数组越界'
where crash_desc is null
and exception_stack like '%OutOfBoundsException%'
update CrashDB
set crash_desc = 'java.lang.VerifyError'
where crash_desc is null
and exception_stack like '%java.lang.VerifyError%'
update CrashDB
set crash_desc = '各个页面的空指针'
where crash_desc is null
and exception_stack like '%NullPointerException%'
update CrashDB
set crash_desc = 'is your activity running?'
where crash_desc is null
and exception_stack like '%is your activity running?%'
update CrashDB
set crash_desc = 'doInBackground'
where crash_desc is null
and exception_stack like '%doInBackground%'
update CrashDB
set crash_desc = 'view not attached to window manager'
where crash_desc is null
and exception_stack like '%not attached to window manager%'
update CrashDB
set crash_desc = 'Package manager has died'
where crash_desc is null
and exception_stack like '%Package manager has died%'
update CrashDB
set crash_desc = 'NoSuchMethodError'
where crash_desc is null
and exception_stack like '%NoSuchMethodError%'
update CrashDB
set crash_desc = 'SQLiteException相关'
where crash_desc is null
and exception_stack like '%SQLite%'
update CrashDB
set crash_desc = 'Looper.prepare()'
where crash_desc is null
and exception_stack like '%Looper.prepare()%'
update CrashDB
set crash_desc = 'UnsatisfiedLinkError'
where crash_desc is null
and exception_stack like '%UnsatisfiedLinkError:%'
update CrashDB
set crash_desc = 'Resources$NotFoundException'
where crash_desc is null
and exception_stack like '%Resources$NotFoundException%'
update CrashDB
set crash_desc = 'InflateException'
where crash_desc is null
and exception_stack like '%InflateException%'
update CrashDB
set crash_desc = 'Failure delivering result ResultInfo'
where crash_desc is null
and exception_stack like '%Failure delivering result ResultInfo%'
update CrashDB
set crash_desc = 'ListView刷新数据'
where crash_desc is null
and exception_stack like '%The content of the adapter has changed but ListView did not receive a notification%'
update CrashDB
set crash_desc = 'NumberFormatException'
where crash_desc is null
and exception_stack like '%NumberFormatException%'
update CrashDB
set crash_desc = '各个页面的空指针'
where crash_desc is null
and exception_stack like '%NullPointerException%'
update CrashDB
set crash_desc = '窗体泄露'
where crash_desc is null
and exception_stack like '%The specified child already has a parent. You must call removeView()%'
update CrashDB
set crash_desc = 'TransactionTooLargeException'
where crash_desc is null
and exception_stack like '%TransactionTooLargeException%'
update CrashDB
set crash_desc = 'Fragment相关1: Can not perform this action after onSaveInstanceState'
where crash_desc is null
and exception_stack like '%Can not perform this action after onSaveInstanceState%'
update CrashDB
set crash_desc = 'Fragment相关2: Fragment already added'
where crash_desc is null
and exception_stack like '%Fragment already added%'
update CrashDB
set crash_desc = 'ActivityNotFoundException:'
where crash_desc is null
and exception_stack like '%ActivityNotFoundException:%'
update CrashDB
set crash_desc = 'parameter must be a descendant of this view'
where crash_desc is null
and exception_stack like '%parameter must be a descendant of this view%'
update CrashDB
set crash_desc = 'Permission相关'
where crash_desc is null
and exception_stack like '%permission%'
update CrashDB
set crash_desc = 'libcore.io.ErrnoException: getsockname failed'
where crash_desc is null
and exception_stack like '%libcore.io.ErrnoException: getsockname failed%'
update CrashDB
set crash_desc = 'libcore.io.DiskLruCache'
where crash_desc is null
and exception_stack like '%libcore.io.DiskLruCache%'
update CrashDB
set crash_desc = 'Unknown component'
where crash_desc is null
and exception_stack like '%Unknown component%'
update CrashDB
set crash_desc = 'Unable to initialize media recorder'
where crash_desc is null
and exception_stack like '%Unable to initialize media recorder%'
update CrashDB
set crash_desc = 'Could not read input channel file descriptors from parcel'
where crash_desc is null
and exception_stack like '%Could not read input channel file descriptors from parcel%'
update CrashDB
set crash_desc = 'Unable to add window'
where crash_desc is null
and exception_stack like '%Unable to add window%'
update CrashDB
set crash_desc = 'NoClassDefFoundError'
where crash_desc is null
and exception_stack like '%java.lang.NoClassDefFoundError%'
update CrashDB
set crash_desc = 'EGL相关'
where crash_desc is null
and exception_stack like '%Could not create an EGL context%'
update CrashDB
set crash_desc = 'NoSuchFieldError'
where crash_desc is null
and exception_stack like '%NoSuchFieldError%'
update CrashDB
set crash_desc = '百度相关'
where crash_desc is null
and exception_stack like '%baidu%'
update CrashDB
set crash_desc = 'Unable to create application'
where crash_desc is null
and exception_stack like '%Unable to create application%'
update CrashDB
set crash_desc = 'GoogleAnalytics相关1: Package manager has die'
where exception_stack like '%google%' and crash_desc='Package manager has die'
update CrashDB
set crash_desc = 'GoogleAnalytics相关2: 空指针'
where exception_stack like '%google%' and crash_desc='各个页面的空指针'
update CrashDB
set crash_desc = 'GoogleAnalytics相关3: TransactionTooLargeException'
where exception_stack like '%google%' and crash_desc='TransactionTooLargeException'
update CrashDB
set crash_desc = 'GoogleAnalytics相关4: 不明觉厉'
where exception_stack like '%google%' and crash_desc is null
update CrashDB
set crash_desc = 'TimeoutException相关'
where crash_desc is null and exception_stack like '%TimeoutException%'
update CrashDB
set crash_desc = 'jpush相关'
where crash_desc is null and exception_stack like '%jpush%'
update CrashDB
set crash_desc = 'bitmap size exceeds 32bits'
where exception_stack like '%bitmap size exceeds 32bits%'
and crash_desc is null
update CrashDB
set crash_desc = 'Method called after release()
at android.hardware.Camera.startPreview'
where exception_stack like '%Method called after release()
at android.hardware.Camera.startPreview%'
and crash_desc is null
update CrashDB
set crash_desc = 'Service Intent must be explicit: Intent { act=com.sina.weibo.remotessoservice }'
where exception_stack like '%Service Intent must be explicit: Intent { act=com.sina.weibo.remotessoservice }%'
and crash_desc is null
update CrashDB
set crash_desc = 'EventBusException'
where exception_stack like '%EventBusException%'
and crash_desc is null
update CrashDB
set crash_desc = 'divide by zero'
where exception_stack like '%divide by zero%'
and crash_desc is null
update CrashDB
set crash_desc = ' Broadcast already finished'
where exception_stack like '% Broadcast already finished%'
and crash_desc is null
update CrashDB
set crash_desc = 'java.lang.UnsupportedOperationException
at android.view.GLES20Canvas.clipPath'
where exception_stack like '%java.lang.UnsupportedOperationException
at android.view.GLES20Canvas.clipPath%'
and crash_desc is null
update CrashDB
set crash_desc = 'java.lang.IllegalArgumentException: height must be & 0
at android.graphics.Bitmap.checkWidthHeight'
where exception_stack like '%java.lang.IllegalArgumentException: height must be & 0
at android.graphics.Bitmap.checkWidthHeight%'
and crash_desc is null
update CrashDB
set crash_desc = 'native typeface cannot be made'
where exception_stack like '%native typeface cannot be made%'
and crash_desc is null
update CrashDB
set crash_desc = 'Fragment not attached to Activity'
where exception_stack like '%not attached to Activity%'
and crash_desc is null
update CrashDB
set crash_desc = 'java.lang.StackOverflowError
at android.text.StaticLayout.generate'
where exception_stack like '%java.lang.StackOverflowError
at android.text.StaticLayout.generate%'
and crash_desc is null
update CrashDB
set crash_desc = '不明觉厉'
where crash_desc is null
5)GroupOnlineCrash
CREATE PROCEDURE [dbo].[GroupOnlineCrash]
SET NOCOUNT ON;
select * into #temp1 from CrashDB
where client_type=20
order by page_name, exception_name, exception_stack
select crash_desc, COUNT(crash_desc) as count from #temp1
group by crash_desc
order by COUNT(crash_desc) desc
6)UpdateCrashStore存储过程
CREATE PROCEDURE [dbo].[UpdateCrashStore]
@version varchar(30)
SET NOCOUNT ON;
select * into #temp1 from CrashDB
-- 1. 排除java.lang.VerifyError之类Crash对去重结果的影响
delete from #temp1
where SUBSTRING(dis_info, 1, 38)
= 'java.lang.VerifyError: Rejecting class'
-- 1.x 这里可以添加其它排除语句,减少对去重逻辑的干扰
-- 2. 取dis_info的前150个字符,去重
select distinct page_name,
SUBSTRING(dis_info, 1, 150) as sub_crash_desc
into #temp2 from #temp1
order by page_name, SUBSTRING(dis_info, 1, 150)
-- 3. 在CrashStore表中,取出当前版本的之前已经统计过的Crash
select * into #tempCrashStore from CrashStore
where app_version=@version
-- 4. 使用left join语句,筛选出今天的、未统计过的Crash
select t.page_name, t.sub_crash_desc
into #temp4 from #temp2 t
left join #tempCrashStore c
on c.page_name = t.page_name
and c.sub_crash_desc = t.sub_crash_desc
where c.categoty_id is null
-- 5. 将今天统计的Crash放入CrashStore表
insert CrashStore(page_name, sub_crash_desc,
sub_crash_length, app_version)
select distinct page_name, sub_crash_desc,
150, @version from #temp4
7)PageOwner表
CREATE TABLE [dbo].[PageOwner](
[Activity] [nvarchar](100) NOT NULL,
[Owner] [nvarchar](100) NOT NULL,
CONSTRAINT [PK_PageOwner] PRIMARY KEY CLUSTERED
[Activity] ASC
)WITH (PAD_INDEX
= OFF, STATISTICS_NORECOMPUTE
= OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS
= ON, ALLOW_PAGE_LOCKS
= ON) ON [PRIMARY]
) ON [PRIMARY]
8)AnslysisCrash工具
&/files/Jax/AnalysisCrash.zip
9)CrashHandler
package com.youngheart.
import java.io.F
import java.io.FileOutputS
import java.io.PrintW
import java.io.StringW
import java.io.W
import java.lang.Thread.UncaughtExceptionH
import java.text.DateF
import java.text.SimpleDateF
import java.util.ArrayL
import java.util.D
import java.util.HashM
import java.util.M
import android.app.ActivityM
import android.app.ActivityManager.MemoryI
import android.content.C
import android.content.pm.ApplicationI
import android.content.pm.PackageI
import android.content.pm.PackageM
import android.content.pm.PackageManager.NameNotFoundE
import android.net.ConnectivityM
import android.net.NetworkI
import android.os.E
import android.os.L
import android.provider.Settings.S
import android.telephony.TelephonyM
import android.text.TextU
import android.util.L
import android.widget.T
import com.infrastructure.net.RequestP
import com.infrastructure.net.URLD
* UncaughtException处理类,当程序发生Uncaught异常的时候,
* 由该类来接管程序,并记录发送错误报告.
* 需要在Application中注册,为了要在程序启动器就监控整个程序。
public class CrashHandler implements UncaughtExceptionHandler {
public static final String TAG = "CrashHandler";
public static final String APP_CACHE_PATH =
Environment.getExternalStorageDirectory().getPath()
+ "/YoungHeart/crash/";
// 系统默认的UncaughtException处理类
private Thread.UncaughtExceptionHandler mDefaultH
// CrashHandler实例
private static CrashH
// 程序的Context对象
// 用来存储设备信息和异常信息
private Map&String, String& infos = new HashMap&String, String&();
// 用于格式化日期,作为日志文件名的一部分
private DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
/** 保证只有一个CrashHandler实例 */
private CrashHandler() {
/** 获取CrashHandler实例 ,单例模式 */
public static CrashHandler getInstance() {
if (instance == null)
instance = new CrashHandler();
public void init(Context context) {
// 获取系统默认的UncaughtException处理器
mDefaultHandler = Thread.getDefaultUncaughtExceptionHandler();
// 设置该CrashHandler为程序的默认处理器
Thread.setDefaultUncaughtExceptionHandler(this);
* 切换发生Crash所在的Activity
public void switchCrashActivity(Context context) {
this.context =
* 当UncaughtException发生时会转入该函数来处理
public void uncaughtException(Thread thread, Throwable ex) {
if (!handleException(ex) && mDefaultHandler != null) {
// 如果用户没有处理则让系统默认的异常处理器来处理
mDefaultHandler.uncaughtException(thread, ex);
Thread.sleep(3000);
} catch (InterruptedException e) {
Log.e(TAG, "error : ", e);
// 退出程序
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(1);
* 自定义错误处理,收集错误信息 发送错误报告等操作均在此完成.
* @param ex
* @return true:如果处理了该异常信息;否则返回false.
private boolean handleException(Throwable ex) {
if (ex == null) {
return false;
//把crash发送到服务器
sendCrashToServer(context, ex);
// 使用Toast来显示异常信息
new Thread() {
public void run() {
Looper.prepare();
Toast.makeText(context, "很抱歉,程序出现异常,即将退出.",
Toast.LENGTH_SHORT).show();
Looper.loop();
}.start();
// 保存日志文件
saveCrachInfoInFile(ex);
return true;
* 保存错误信息到文件中
* @param ex
* @return 返回文件名称,便于将文件传送到服务器
private String saveCrachInfoInFile(Throwable ex) {
StringBuffer sb = new StringBuffer();
for (Map.Entry&String, String& entry : infos.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
sb.append(key + "=" + value + "\n");
Writer writer = new StringWriter();
PrintWriter printWriter = new PrintWriter(writer);
ex.printStackTrace(printWriter);
Throwable cause = ex.getCause();
while (cause != null) {
cause.printStackTrace(printWriter);
cause = cause.getCause();
printWriter.close();
String result = writer.toString();
sb.append(result);
long timestamp = System.currentTimeMillis();
String time = formatter.format(new Date());
String fileName = "crash-" + time + "-" + timestamp + ".log";
if (Environment.getExternalStorageState().equals(
Environment.MEDIA_MOUNTED)) {
File dir = new File(APP_CACHE_PATH);
if (!dir.exists()) {
dir.mkdirs();
FileOutputStream fos = new FileOutputStream(APP_CACHE_PATH + fileName);
fos.write(sb.toString().getBytes());
fos.close();
return fileN
} catch (Exception e) {
Log.e(TAG, "an error occured while writing file...", e);
return null;
* 收集程序崩溃的相关信息
* @param ctx
public void sendCrashToServer(Context ctx, Throwable ex) {
//取出版本号
PackageManager pm = ctx.getPackageManager();
PackageInfo pi = null;
pi = pm.getPackageInfo(ctx.getPackageName(),
PackageManager.GET_ACTIVITIES);
if (pi != null) {
String versionName = pi.versionName == null ? "null"
: pi.versionN
String versionCode = pi.versionCode + "";
infos.put("versionName", versionName);
infos.put("versionCode", versionCode);
} catch (NameNotFoundException e1) {
e1.printStackTrace();
HashMap&String, String& exceptionInfo = new HashMap&String, String&();
ActivityManager am = (ActivityManager) ctx
.getSystemService(Context.ACTIVITY_SERVICE);
String pageName = ctx.getClass().getName();
MemoryInfo mi = new MemoryInfo();
am.getMemoryInfo(mi);
String memoryInfo = "Memory info:" + mi.availMem + ",app holds:"
+ mi.threshold + ",Low Memory:" + mi.lowM
ApplicationInfo appInfo = ctx.getPackageManager()
.getApplicationInfo(ctx.getPackageName(),
PackageManager.GET_META_DATA);
String channelId = appInfo.metaData.getString("UMENG_CHANNEL");
String version = ctx.getPackageManager().getPackageInfo(
ctx.getPackageName(), 0).versionN
exceptionInfo.put("PageName", pageName);
exceptionInfo.put("ExceptionName", ex.getClass().getName());
exceptionInfo.put("ExceptionType", "1");
exceptionInfo.put("ExceptionsStackDetail", getStackTrace(ex));
exceptionInfo.put("AppVersion", version);
exceptionInfo.put("OSVersion",
android.os.Build.VERSION.RELEASE);
exceptionInfo.put("DeviceModel", android.os.Build.MODEL);
exceptionInfo.put("DeviceId", getDeviceID(ctx));
exceptionInfo.put("NetWorkType", String.valueOf(isWifi(context)));
exceptionInfo.put("ChannelId", channelId);
exceptionInfo.put("ClientType", "100");
exceptionInfo.put("MemoryInfo", memoryInfo);
final String rquestParam = exceptionInfo.toString();
new Thread() {
public void run() {
ArrayList&RequestParameter& params = new ArrayList&RequestParameter&();
RequestParameter rp1 = new RequestParameter("cityaA2", "111");
params.add(rp1);
URLData urlData = new URLData();
urlData.setKey("sed");
RemoteService.getInstance().invoke("getWeatherInfo", params);
}.start();
} catch (Exception e) {
e.printStackTrace();
* @Title: getDeviceID
* @Description: 获取手机设备号
* @param context
* @return String
public static final String getDeviceID(Context context) {
String deviceId = null;
TelephonyManager tm = (TelephonyManager) context
.getSystemService(Context.TELEPHONY_SERVICE);
deviceId = tm.getDeviceId();
tm = null;
if (TextUtils.isEmpty(deviceId)) {
deviceId = Secure.getString(context.getContentResolver(),
Secure.ANDROID_ID);
} catch (Exception e) {
deviceId = Secure.getString(context.getContentResolver(),
Secure.ANDROID_ID);
return deviceId;
private String getStackTrace(Throwable th) {
final Writer result = new StringWriter();
final PrintWriter printWriter = new PrintWriter(result);
// If the exception was thrown in a background thread inside
// AsyncTask, then the actual exception can be found with getCause
Throwable cause =
while (cause != null) {
cause.printStackTrace(printWriter);
cause = cause.getCause();
final String stacktraceAsString = result.toString();
printWriter.close();
return stacktraceAsS
private static int isWifi(Context mContext) {
ConnectivityManager connectivityManager = (ConnectivityManager) mContext
.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetInfo = connectivityManager.getActiveNetworkInfo();
if (activeNetInfo != null
&& activeNetInfo.getType() == ConnectivityManager.TYPE_WIFI) {
Views(...) Comments()

我要回帖

更多关于 segment too large 的文章

 

随机推荐