安卓,一打开app就出现异常,崩溃了

图片说明

ActivityDiaryEdit.java

 package com.exae.shiyongsqlite;

import java.util.Calendar;

import android.app.Activity;
import android.content.ContentValues;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class ActivityDiaryEdit extends Activity implements OnClickListener {
    private Button bt;
    private EditText mTitleText,mBodyText;
    DatabaseHelper mDbHelper;
    private long mRowId;
    private SQLiteDatabase mDb;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.editdiary);
        mDbHelper=new DatabaseHelper(this);
        mDb=mDbHelper.getWritableDatabase();
        bt=(Button)findViewById(R.id.position);
        bt.setOnClickListener(this);
        mTitleText=(EditText)findViewById(R.id.et1);
        mBodyText=(EditText)findViewById(R.id.et2);
        Bundle extras=getIntent().getExtras();
        if(extras!=null)
        {
            String title=extras.getString("title");
            String body=extras.getString("body");
            mRowId=extras.getLong("_id");
            if(title!=null)
            {
                mTitleText.setText(title);
            }
            if(body!=null)
            {
                mBodyText.setText(body);
            }
        }
    }

    public long createDiary(String title,String body)
    {
        ContentValues initialValues=new ContentValues();
        initialValues.put("title", title);
        initialValues.put("body", body);
        Calendar calendar=Calendar.getInstance();
        String created=calendar.get(Calendar.YEAR)+"年"+calendar.get(Calendar.MONTH)+"月"+calendar.get(Calendar.DAY_OF_MONTH)+"日"+calendar.get(Calendar.HOUR_OF_DAY)+"小时"+calendar.get(Calendar.MINUTE)+"分钟";
        initialValues.put("created", created);
        return mDb.insert("diary",null,initialValues);
    }

    public boolean updateDiary(long rowId,String title,String body)
    {
        ContentValues args=new ContentValues();
        args.put("title", title);
        args.put("body", body);
        Calendar calendar=Calendar.getInstance();
        String created=calendar.get(Calendar.YEAR)+"年"+calendar.get(Calendar.MONTH)+"月"+calendar.get(Calendar.DAY_OF_MONTH)+"日"+calendar.get(Calendar.HOUR_OF_DAY)+"小时"+calendar.get(Calendar.MINUTE)+"分钟";
        args.put("created", created);
        return mDb.update("diary",args,"_id"+"="+rowId,null)>0;
    }



    @Override
    public void onClick(View v) {
        switch (v.getId()) {
        case R.id.position:
            String title=mTitleText.getText().toString();
            String body=mBodyText.getText().toString();
            if(mRowId!=0)
            {
                updateDiary(mRowId,title,body);
            }
            else
                createDiary(title,body);
            Intent mIntent=new Intent();
            setResult(RESULT_OK,mIntent);
            finish();
        }
    }



}

DatabaseHelper.java

 package com.exae.shiyongsqlite;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DatabaseHelper extends SQLiteOpenHelper{
    public DatabaseHelper(Context context)
    {
        super(context,"database",null,2);
    }

    public void onCreate(SQLiteDatabase db)
    {
        String DATABASE_CREATE="create table diary(_id integer primary key autoincrement,title text,body text,created text);";
        db.execSQL(DATABASE_CREATE);
    }

    public void onUpgrade(SQLiteDatabase db,int arg1,int arg2)
    {
        String sql="DROP TABLE IF EXISTS diary";
        db.execSQL(sql);
        this.onCreate(db);
    }

}

MainActivity.java

 package com.exae.shiyongsqlite;

import java.util.Calendar;

import android.app.ListActivity;
import android.content.ContentValues;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;

public class MainActivity extends ListActivity {
    DatabaseHelper mDbHelper;
    private Cursor mDiaryCursor;
    private SQLiteDatabase mDb;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mDbHelper=new DatabaseHelper(this);
        mDb=mDbHelper.getWritableDatabase();
        renderListView();
    }

    public long createDiary(String title,String body)
    {
        ContentValues initialValues=new ContentValues();
        initialValues.put("title", title);
        initialValues.put("body", body);
        Calendar calendar=Calendar.getInstance();
        String created=calendar.get(Calendar.YEAR)+"年"+calendar.get(Calendar.MONTH)+"月"+calendar.get(Calendar.DAY_OF_MONTH)+"日"+calendar.get(Calendar.HOUR_OF_DAY)+"小时"+calendar.get(Calendar.MINUTE)+"分钟";
        initialValues.put("created", created);
        return mDb.insert("diary",null,initialValues);
    }

    public boolean deleteDiary(long rowId)
    {
        return mDb.delete("diary","_id"+"="+rowId,null)>0;
    }

    public Cursor getAllNotes()
    {
        return mDb.query("diary",new String[]{"_id","title","body","created"},null,null,null,null,null);
    }

    public boolean updateDiary(long rowId,String title,String body)
    {
        ContentValues args=new ContentValues();
        args.put("title", title);
        args.put("body", body);
        Calendar calendar=Calendar.getInstance();
        String created=calendar.get(Calendar.YEAR)+"年"+calendar.get(Calendar.MONTH)+"月"+calendar.get(Calendar.DAY_OF_MONTH)+"日"+calendar.get(Calendar.HOUR_OF_DAY)+"小时"+calendar.get(Calendar.MINUTE)+"分钟";
        args.put("created", created);
        return mDb.update("diary",args,"_id"+"="+rowId,null)>0;
    }



    @Override
    public boolean onMenuItemSelected(int featureId,MenuItem item)
    {
        switch (item.getItemId())
        {
        case Menu.FIRST:
            createDiary();
            return true;
        case Menu.FIRST+1:
            deleteDiary(getListView().getSelectedItemId());
            renderListView();
            return true;
        }
        return super.onMenuItemSelected(featureId, item);
    }

    private void createDiary()
    {
        Intent i=new Intent(this,ActivityDiaryEdit.class);
        startActivityForResult(i,0);
    }

    private void renderListView()
    {
        mDiaryCursor=getAllNotes();
        startManagingCursor(mDiaryCursor);
        String[] from=new String[]{"title","created"};
        int[] to=new int[]{R.id.text1,R.id.created};
        SimpleCursorAdapter notes=new SimpleCursorAdapter(this,R.layout.diary_row,mDiaryCursor,from,to);
        setListAdapter(notes);
    }

    protected void onActivityResult(int requestCode,int resultCode,Intent intent)
    {
        super.onActivityResult(requestCode, resultCode, intent);
        renderListView();
    }

    protected void onListItemClick(ListView l,View v,int position,long id)
    {
        super.onListItemClick(l,v,position,id);
        Cursor c=mDiaryCursor;
        c.moveToPosition(position);
        Intent i=new Intent(this,ActivityDiaryEdit.class);
        i.putExtra("_id", id);
        i.putExtra("title", c.getString(c.getColumnIndexOrThrow("title")));
        i.putExtra("body", c.getString(c.getColumnIndexOrThrow("body")));
        startActivityForResult(i,1);
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        //getMenuInflater().inflate(R.menu.main, menu);
        super.onCreateOptionsMenu(menu);
        menu.add(0, Menu.FIRST, 0, R.string.menu_insert);
        menu.add(0, Menu.FIRST+1, 0, R.string.menu_delete);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }
}

图片说明

6个回答

你的mainactivity是一个listactivity,但是你的mainactivity的布局问件里面没有listview,请加一个进去,id就是错误里面显示的那个

listview id没找到

这种问题一dC般查看
Caused by 后面的提示,比如你这个工程的错误提示 your content must have a ListView whoes...
就知道ListView出了问题,查看你的界面布局看看哪里有用到ListView,再结合后面的提示就知道问题在哪了
当然:英文要懂一点 方法也要有一点

引用的第三方库有问题

布局文件内容在这里。。。。。。。。。。图片图片

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
安卓 app界面崩溃
代码没提示错误,就是app运行时出现了错误
一打开工程VS2010就崩溃,怎么回事??
昨天打开web应程程序还能正常的修改编译等没有问题,今天早上打开了一个C#窗体应用程序进程修改,之后又新建了一个WebServer服务程序编程编译等也没问题。但是到下午我一打开昨天的Web应用程序VS就挂掉了,打开其他的C#、.Net的工程都是一样,但是打开MFC工程没有崩溃。查看系统应用程序事件如下:rn/////////////////rn错误应用程序名称: devenv.exe,版本: 10.0.30319.1,时间戳: 0x4ba1fab3rn错误模块名称: msenv.dll,版本: 10.0.30319.1,时间戳: 0x4ba1fd94rn异常代码: 0xc0000005rn错误偏移量: 0x0008be60rn错误进程 ID: 0x5b30rn错误应用程序启动时间: 0x01cf433a9f05ced2rn错误应用程序路径: D:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exern错误模块路径: D:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\msenv.dllrn///////////////rnrn然后又新建项目,不管是Web应用程序、C#窗体程序还是MFC程序,都新建不了,出现如下的错误框:rn[img=https://img-bbs.csdn.net/upload/201403/19/1395215666_512042.png][/img]rnrn这怎么解决啊??
一连接数据库就崩溃
win7下安装了vs2010旗舰版,想要用vs10做一个基于MFC连接Access的程序,在创建MFC应用程序选了数据库支持用ODBC连接Access2010,一点击完成就崩溃,同样后面添加类选MFC ODBC 使用者。。。 也一样崩溃,白花花的一片然后自动重新打开。我试过打了VS10和win7的补丁,不行。。。又装Access2003试了下,不行。。。和office先后安装的顺序没有关系(已验证)。。还是不行,同样的问题,困扰了几天。。。小弟初用vs,求大神帮助。。感激不尽。。。。
app一打开就闪退是什么问题?
公司的一个项目,有一段时间没用了,今天一打开就闪退,ios端这边几乎都这样,请问是什么原因?rn用xcode 运行没问题,不奔溃,用第三方工具也收集不到奔溃报告
vs2015打开 CSS文件就崩溃
如题rn然后就弹出这个框 ,确定后,VS点不动了.只好结束任务rnrn[img=https://img-bbs.csdn.net/upload/201804/27/1524803939_172416.jpg][/img]rnHELP!
device_create一调用就崩溃
int result;rn int i;rnrn dev_t devno ;rnrn /* Ÿ²Ì¬ÉêÇëÉ豞ºÅ*/rn //if (mem_major)rn // result = register_chrdev_region(devno, 2, "memdev");rn //else /* ¶¯Ì¬·ÖÅäÉ豞ºÅ */rn //rn result = alloc_chrdev_region(&devno, 0, 1, "memdev");rn mem_major = MAJOR(devno);rn // rn rn if (result < 0)rn return result;rnrn /*³õÊŒ»¯cdevœá¹¹*/rn cdev_init(&cdev, &mem_fops);rn cdev.owner = THIS_MODULE;rn cdev.ops = &mem_fops;rn rn /* ×¢²á×Ö·ûÉ豞 */rn cdev_add(&cdev, devno, MEMDEV_NR_DEVS);rn rn /* ΪÉ豞ÃèÊöœá¹¹·ÖÅäÄÚŽæ*/rn mem_devp = kmalloc(MEMDEV_NR_DEVS * sizeof(struct mem_dev), GFP_KERNEL);rn if (!mem_devp) /*ÉêÇëʧ°Ü*/rn rn result = - ENOMEM;rn goto fail_malloc;rn rn memset(mem_devp, 0, sizeof(struct mem_dev));rn rn /*ΪÉ豞·ÖÅäÄÚŽæ*/rn for (i=0; i < MEMDEV_NR_DEVS; i++) rn rn mem_devp[i].size = MEMDEV_SIZE;rn mem_devp[i].data = kmalloc(MEMDEV_SIZE, GFP_KERNEL);rn memset(mem_devp[i].data, 0, MEMDEV_SIZE);rn rn rn myclass=class_create(THIS_MODULE,"my_device_class");rn if(IS_ERR(myclass)) rn rn printk("<0>""Err: failed in creating class.\n");rn return -1; rn rnrn dev=device_create(myclass,NULL,devno,NULL,"my_device");//出错行rnif(IS_ERR(dev)) rn rn printk("<0>""Err: failed in creating device.\n");rn return -1; rn rn return 0;rnrn fail_malloc: rn unregister_chrdev_region(devno, 1);rn rn return result;rnrnrninit程序删掉device_create就没问题
程序一运行就崩溃
[code=Assembly]rnrn .386rn .model flat,stdcallrn option casemap:nonernrninclude windows.incrninclude user32.incrnincludelib user32.librninclude kernel32.incrnincludelib kernel32.librnrnrn DLG_MAIN EQU 1000rn IDC_COUNTER EQU 1001rnrn IDC_PAUSE EQU 1002rn rn .data?rn hInstance dd ?rnhWinMain dd ?rnhWinCount dd ?rnhWinPause dd ?rnrndwOption dd ? ;标志位rnF_PAUSE EQU 0001hrnF_STOP EQU 0002hrnF_COUNTING EQU 0004h ;计算中rn .constrnszStop db '停止计数',0rnszStart db '计数',0rnrn .codern_Counter proc uses ebx esi edi _lParamrn rn or dwOption,F_COUNTINGrn and dwOption,not (F_STOP OR F_PAUSE)rn invoke SetWindowText,hWinCount,addr szStoprn invoke EnableWindow,hWinPause,TRUErn rn xor ebx,ebxrn .while ! (dwOption & F_STOP)rn .if !(dwOption & F_PAUSE)rn inc ebxrn invoke SetDlgItemInt,hWinMain,IDC_COUNTER,ebx,FALSErn .endifrn .endwrn rn invoke SetWindowText,hWinCount,addr szStartrn invoke EnableWindow,hWinPause,FALSErn and dwOption,not (F_COUNTING OR F_STOP OR F_PAUSE)rn rn retrnrn_Counter endprnrn_ProcDlgMain proc uses ebx edi esi hWnd,wMsg,wParam,lParamrn rn LOCAL @dwThreadIDrn rn mov eax,wMsgrn .if eax == WM_COMMANDrn mov eax,wParamrn .if ax == IDOKrn .if dwOption & F_COUNTINGrn or dwOption,F_STOPrn .elsern invoke CreateThread,NULL,0,offset _Counter,NULL,NULL,@dwThreadIDrn invoke CloseHandle,eaxrn .endifrn .elseif ax == IDC_PAUSErn xor dwOption,F_PAUSErn .endifrn .elseif eax == WM_CLOSErn invoke EndDialog,hWnd,NULLrn .elseif eax == WM_INITDIALOGrn push hWndrn pop hWinMainrn invoke GetDlgItem,hWnd,IDOKrn mov hWinCount,eaxrn invoke GetDlgItem,hWnd,IDC_PAUSErn mov hWinPause,eaxrn .elsern mov eax,FALSErn retrn .endifrn mov eax,TRUErn retrnrn_ProcDlgMain endprnrnstart:rn invoke GetModuleHandle,NULLrn mov hInstance,eaxrn invoke DialogBoxParam,hInstance,DLG_MAIN,NULL,offset _ProcDlgMain,NULLrn invoke ExitProcess,NULLrn end startrn[/code]rnrnrn.rcrn[code=C/C++]rn#include rn#define DLG_MAIN 1000rn#define IDC_COUNTER 1001rn#define IDC_PAUSE 1002rnrnDLG_MAIN DIALOGEX 10,10,237,111rnCAPTION "计数"rnFONT 8,"MS Sans Serif",0,0,0rnSTYLE WS_VISIBLE|WS_OVERLAPPEDWINDOWrnBEGINrn CONTROL "",IDC_COUNTER,"Edit",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,33,21,78,18,WS_EX_CLIENTEDGErn CONTROL "计数",IDOK,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,36,63,60,24rn CONTROL "暂停/恢复",IDC_PAUSE,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,126,63,60,24rnENDrn[/code]rnrn一点计数就崩溃,不知是哪的问题呢?
安卓APP版本更新及自动打开
安卓APP自动更新版本功能及安装完成后自动打开
安卓,点击了我同意,就崩溃了
![图片说明](https://img-ask.csdn.net/upload/201612/24/1482532099_426435.jpg)n![图片说明](https://img-ask.csdn.net/upload/201612/24/1482532115_877358.jpg)n![图片说明](https://img-ask.csdn.net/upload/201612/24/1482532128_315302.png)nMainActivity.javannn```n package com.ample.receive;nnimport android.app.Activity;nimport android.os.Bundle;nimport android.view.Menu;nimport android.view.MenuItem;nimport android.view.View;nimport android.view.View.OnClickListener;nimport android.widget.Button;nimport android.widget.CheckBox;nimport android.widget.TextView;nnpublic class MainActivity extends Activity implements OnClickListenern private TextView myTextView1;n private TextView myTextView2;n private CheckBox myCheckBox;n private Button myButton;n n @Overriden protected void onCreate(Bundle savedInstanceState) n super.onCreate(savedInstanceState);n setContentView(R.layout.activity_main);n myCheckBox=(CheckBox)findViewById(R.id.myCheckBox);n myCheckBox.setChecked(false);n myCheckBox.setOnClickListener(this);n myButton=(Button)findViewById(R.id.myButton);n myButton.setEnabled(false);n myButton.setOnClickListener(this);n n n @Overriden public void onClick(View v) n switch (v.getId()) n case R.id.myCheckBox:n if (myCheckBox.isChecked())n n myButton.setEnabled(true);n myTextView2.setText("abc");n n elsen n myButton.setEnabled(false);n myTextView1.setText(R.string.text);n myTextView2.setText(R.string.no);n n break;n case R.id.myButton:n if (myCheckBox.isChecked())n n myTextView1.setText(R.string.ok);n n break;n default:break;n n nn @Overriden public boolean onCreateOptionsMenu(Menu menu) n // Inflate the menu; this adds items to the action bar if it is present.n getMenuInflater().inflate(R.menu.main, menu);n return true;n nn @Overriden public boolean onOptionsItemSelected(MenuItem item) n // Handle action bar item clicks here. The action bar willn // automatically handle clicks on the Home/Up button, so longn // as you specify a parent activity in AndroidManifest.xml.n int id = item.getItemId();n if (id == R.id.action_settings) n return true;n n return super.onOptionsItemSelected(item);n nnn```nn
自学安卓app开发(一)
记录一个小白在自学app的道路上的大起大落落落落落落… 参考书目:《app和移动网站开发案例课堂》 配置Android开发环境 1.安装jdk,Android SDK,Apache Ant,具体教程网上有 注意:Android SDK与Apache Ant要放在同一个目录下 2.配置环境变量,三个都要配置 JAVA_HOME C:\Program Files\Java\jdk1.8.0_144 A...
打开一个app就闪退
最近在学android,这边有个小问题,打开这个应用就闪退是什么原因?rn[code=java]rnpackage com.example.linearlayouttest;rnrnrnrnimport android.os.Bundle;rnimport android.app.Activity;rnimport android.view.Menu;rnimport android.widget.Button;rnimport android.widget.LinearLayout;rnrnpublic class LinearLayoutTest extends Activity rnrn @Overridern protected void onCreate(Bundle savedInstanceState) rn super.onCreate(savedInstanceState);rn setContentView(R.layout.activity_linear_layout_test);rn LinearLayout root =(LinearLayout)findViewById(R.id.root);rn Button bn1=(Button)findViewById(R.id.bn1);rn bn1.setText(R.string.bn1);rn root.addView(bn1);rn Button bn2=(Button)findViewById(R.id.bn2);rn bn2.setText(R.string.bn2);rn root.addView(bn2);rn rnrn @Overridern public boolean onCreateOptionsMenu(Menu menu) rn // Inflate the menu; this adds items to the action bar if it is present.rn getMenuInflater().inflate(R.menu.linear_layout_test, menu);rn return true;rn rnrnrn[/code]rn[code=html]rnrnrn rnrnrnrnrnrn[/code]
Android app 崩溃 & Crash 分析(一)
崩溃现场 崩溃现场是我们的“第一案发现场”,它保留着很多有价值的线索。在这里我们挖掘到的信息越多,下一步分析的方向就越清晰。 操作系统是整个崩溃过程的“旁观者”,也是我们最重要的“证人”,也是我们最重要的“证人”。 一个好的崩溃捕获工具知道应该采集哪些系统信息,也知道在什么场景要深入挖掘哪些内容。 1.1 崩溃信息 从崩溃的基本信息,我们可以对崩溃有初步的判断。 进程名、线程名。...
Retrofit+RxJava实现app崩溃处理(一)上传文件
这里主要讲一下当软件运行崩溃时,将错误日志保存到本地,然后上传到服务器 1.新建CrashHelper类实现Thread.UncaughtExceptionHandler的接口public class CrashHandler implements Thread.UncaughtExceptionHandler { public static final String TAG = "Cra
VS2015打开特定项目就崩溃
今天在打开之前写的项目的时候,一开vs就崩溃关闭了,打开其他项目的.sln和.vsproj就可以,唯独有1个项目打不开,也不知道为啥,气死了。去网上找到的解决办法: 步骤1:开始–>所有程序–>Microsoft Visual Studio 2012–>Visual Studio Tools–>VS2012 开发人员命令提示(以管理员方式运行)步骤2:运行devenv /Safemode 步骤3:
【Unity】打开项目就发生crash崩溃
这是一个总结帖,把网上常见的几种解决方案整理一下:(我是用第一种方式解决的) 解决方法 1.删除除了Assets/ProjectSettings以外的其他文件夹,然后重新打开项目。原文链接 (对于由于用不同版本Unity打开工程造成的报错也有用) Unity每次编译都会生成这个东西,不用担心丢失的问题。所以,干掉他! 缺点:如果工程过大,重新编译时间会比较长。(但是对于查Log日志来说,...
打开Aspx或Xml文档.Net就崩溃!!!
我的Framework是1.0版本, VS.Net2002. 各位大侠救命啊. 一打开就弹出对话框说程序错误, 是否需要调试, 还有个Restart .Net的CheckBox.
PB打开一个窗体就崩溃
PB9,以前打开这窗口编辑代码的时候都好好的,但从昨天开始就崩溃。rn代码应该没有问题,因为将代码拷贝到其他机上都可以打开,PB都重装过了,还是没用,唯有拜托各位达人了。。
我要崩溃了。。。。我的机子一运行JAVA图形界面的程序就崩溃!!!
为什么我在WINXP sp2 下一运行带图形界面的JAVA软件就崩溃,如JBuilder,Matlab等,但Eclipse能正常运行。状况是白屏,提示显卡驱动程序崩溃。只能重启。。然而同一台机子上Linux下却一切正常??rn我原来是256M内存,没出国问题。。现在换成512就这样了。怀疑是内存的问题,然后我换了很多条内存情况还是一样。究竟怎么回事啊!!!郁闷!!!谁能告诉我!!!
一创建数据窗口PB就崩溃
用的是PB8,补丁刚打到了8.0.4 10501 rn用的是oracle数据库,没打补丁以前也是,一创建数据窗口PB就崩溃,打上这个补丁了还是这个问题.rn谁能帮下,赶紧不尽,rn有新的PB 8.0 的补丁发给我也行,rn我邮箱: fly_0521@163.comrn或者给出个可能出错的原因
一点击添加联系人就崩溃
[img=https://img-bbs.csdn.net/upload/201704/04/1491251800_85524.png][/img]rnContactColumn.javarn[code=java]package com.contact.simplecontact;rnrnimport android.provider.BaseColumns;rnrnpublic class ContactColumn implements BaseColumnsrn public ContactColumn()rn //列名rn public static final String NAME = "name"; //姓名rn public static final String MOBILENUM = "mobileNumber";//移动电话rn public static final String CREATED = "createdDate"; //家庭电话rn public static final String MODIFIED = "modifiedDate"; //地址rn public static final String EMAIL = "email"; //邮箱rn //列 索引值rn public static final int _ID_COLUMN = 0;rn public static final int NAME_COLUMN = 1;rn public static final int MOBILENUM_COLUMN = 2;rn public static final int EMAIL_COLUMN = 3;rn public static final int CREATED_COLUMN = 4;rn public static final int MODIFIED_COLUMN = 5;rnrn //查询结果rn public static final String[] PROJECTION =rn _ID,rn NAME,rn MOBILENUM,rn EMAILrn ;rnrn [/code]rnContactEditor.javarn[code=java]package com.contact.simplecontact;rnrnimport android.app.Activity;rnimport android.content.ContentValues;rnimport android.content.Intent;rnimport android.database.Cursor;rnimport android.net.Uri;rnimport android.os.Bundle;rnimport android.view.Menu;rnimport android.view.MenuItem;rnimport android.view.View;rnimport android.view.View.OnClickListener;rnimport android.widget.Button;rnimport android.widget.EditText;rnrnpublic class ContactEditor extends Activityrnrn private static final int STATE_EDIT = 0;rn private static final int STATE_INSERT = 1;rn rn private static final int REVERT_ID = Menu.FIRST;rn private static final int DISCARD_ID = Menu.FIRST + 1;rn private static final int DELETE_ID = Menu.FIRST + 2;rn rn private Cursor mCursor;rn private int mState;rn private Uri mUri;rn private EditText nameText;rn private EditText mPhoneText;rn private EditText emailText;rn rn private Button saveButton;rn private Button cancelButton;rn rn private String originalNameText="";rn private String originalPhoneText="";rn private String originalEmailText="";rn public void onCreate(Bundle savedInstanceState) rn rn super.onCreate(savedInstanceState);rnrn final Intent intent = getIntent();rn final String action = intent.getAction();rn //根据action的不同进行不同的操作rn //编辑联系人rn if (Intent.ACTION_EDIT.equals(action))rn rn mState = STATE_EDIT;rn mUri = intent.getData();rn rn else if (Intent.ACTION_INSERT.equals(action))rn rn //添加新联系人rn mState = STATE_INSERT;rn mUri = getContentResolver().insert(intent.getData(), null);rnrn if (mUri == null)rn rn finish();rn return;rn rn setResult(RESULT_OK, (new Intent()).setAction(mUri.toString()));rnrn rn elsern rn finish();rn return;rn rn rn setContentView(R.layout.contact_editor);rn rn nameText = (EditText) findViewById(R.id.editText01);rn mPhoneText = (EditText) findViewById(R.id.editText02);rn emailText = (EditText) findViewById(R.id.editText03);rn rn saveButton = (Button)findViewById(R.id.button01);rn cancelButton = (Button)findViewById(R.id.button02);rn rn saveButton.setOnClickListener(new OnClickListener()rn rn public void onClick(View v) rn rn String text = nameText.getText().toString();rn if(text.length()==0)rn rn //如果没有输入东西,则不添加记录rn setResult(RESULT_CANCELED);rn deleteContact();rn finish();rn rn elsern rn //添加一条数据rn updateContact();rn rn rn rn );rn cancelButton.setOnClickListener(new OnClickListener()rn rn public void onClick(View v) rn rn if(mState == STATE_INSERT)rn rn //不添加记录rn setResult(RESULT_CANCELED);rn deleteContact();rn finish();rn rn elsern rn //恢复到编辑前的状态rn backupContact();rn rn rn );rn rn rn // 获得并保存原始联系人信息rn mCursor = managedQuery(mUri, ContactColumn.PROJECTION, null, null, null);rn mCursor.moveToFirst();rnrn originalNameText=mCursor.getString(ContactColumn.NAME_COLUMN);rn originalPhoneText=mCursor.getString(ContactColumn.MOBILENUM_COLUMN);rn originalEmailText=mCursor.getString(ContactColumn.EMAIL_COLUMN);rn rn rn rn protected void onResume()rn rn super.onResume();rn if (mCursor != null)rn rn // 读取并显示联系人信息rn mCursor.moveToFirst();rn if (mState == STATE_EDIT)rn rn setTitle("编辑联系人");rn rn else if (mState == STATE_INSERT)rn rn setTitle("创建新的联系人");rn rn String name = mCursor.getString(ContactColumn.NAME_COLUMN);rn String mPhone = mCursor.getString(ContactColumn.MOBILENUM_COLUMN);rn String email = mCursor.getString(ContactColumn.EMAIL_COLUMN);rn rn rn nameText.setText(name);rn mPhoneText.setText(mPhone);rn emailText.setText(email);rn rn elsern rn setTitle("错误信息");rn rn rn rn protected void onPause()rn rn super.onPause();rn if (mCursor != null)rn rn String text = nameText.getText().toString();rn if (text.length() == 0)rn rn setResult(RESULT_CANCELED);rn deleteContact();rn // 更新信息rn rn elsern rn ContentValues values = new ContentValues();rn values.put(ContactColumn.NAME, nameText.getText().toString());rn values.put(ContactColumn.MOBILENUM, mPhoneText.getText().toString());rn values.put(ContactColumn.EMAIL, emailText.getText().toString());rn rn rn getContentResolver().update(mUri, values, null, null);rn rn rn rn rn public boolean onCreateOptionsMenu(Menu menu) rn rn super.onCreateOptionsMenu(menu);rnrn if (mState == STATE_EDIT) rn rn menu.add(0, REVERT_ID, 1, "恢复")rn .setShortcut('0', 'r')rn .setIcon(android.R.drawable.ic_menu_revert);rn menu.add(0, DELETE_ID, 2, "删除")rn .setShortcut('0', 'd')rn .setIcon(android.R.drawable.ic_menu_delete);rn rn else rn rn menu.add(0, DISCARD_ID, 3, "丢弃")rn .setShortcut('0', 'd')rn .setIcon(android.R.drawable.ic_menu_delete);rn rn return true;rn rn //菜单处理rn @Overridern public boolean onOptionsItemSelected(MenuItem item) rn rn switch (item.getItemId()) rn rn case DELETE_ID:rn deleteContact();rn finish();rn break;rn case DISCARD_ID:rn cancelContact();rn break;rn case REVERT_ID:rn backupContact();rn break;rn rn return super.onOptionsItemSelected(item);rn rn rn //删除联系人信息rn private void deleteContact() rn rn if (mCursor != null) rn rn mCursor.close();rn mCursor = null;rn getContentResolver().delete(mUri, null, null);rn nameText.setText("");rn rn rnrn //丢弃信息rn private void cancelContact() rn rn if (mCursor != null) rn rn deleteContact();rn rn setResult(RESULT_CANCELED);rn finish();rn rnrn //更新 变更的信息rn private void updateContact() rn rn if (mCursor != null) rn rn mCursor.close();rn mCursor = null;rn ContentValues values = new ContentValues();rn values.put(ContactColumn.NAME, nameText.getText().toString());rn values.put(ContactColumn.MOBILENUM, mPhoneText.getText().toString());rn values.put(ContactColumn.EMAIL, emailText.getText().toString());rn getContentResolver().update(mUri, values, null, null);rn rn setResult(RESULT_CANCELED);rn finish();rn rnrn //取消用,回退到最初的信息rn private void backupContact() rn rn if (mCursor != null) rn rn mCursor.close();rn mCursor = null;rn ContentValues values = new ContentValues();rn values.put(ContactColumn.NAME, this.originalNameText);rn values.put(ContactColumn.MOBILENUM, this.originalPhoneText);rn values.put(ContactColumn.EMAIL, this.originalEmailText);rn getContentResolver().update(mUri, values, null, null);rn rn setResult(RESULT_CANCELED);rn finish();rn rn [/code]rnDBHelper.javarn[code=java]package com.contact.simplecontact;rnrnimport android.content.Context;rnimport android.database.sqlite.SQLiteDatabase;rnimport android.database.sqlite.SQLiteOpenHelper;rnrnpublic class DBHelper extends SQLiteOpenHelperrnrn public static final String DATABASE_NAME = "mycontacts.db";//数据库名rn public static final int DATABASE_VERSION = 2; //版本rn public static final String CONTACTS_TABLE = "contacts"; //表名rn //创建表rn private static final String DATABASE_CREATE = rn "CREATE TABLE " + CONTACTS_TABLE +" (" rn + ContactColumn._ID+" integer primary key autoincrement,"rn + ContactColumn.NAME+" text,"rn + ContactColumn.MOBILENUM+" text,"rn + ContactColumn.EMAIL+" text,"rn + ContactColumn.CREATED+" long," + ContactColumn.MODIFIED+" long);";rn public DBHelper(Context context)rn rn super(context, DATABASE_NAME, null, DATABASE_VERSION);rn rn public void onCreate(SQLiteDatabase db)rn rn db.execSQL(DATABASE_CREATE);rn rn public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)rn rn db.execSQL("DROP TABLE IF EXISTS " + CONTACTS_TABLE);rn onCreate(db);rn rnrn [/code]rncontact_list.xmlrn[code=java]rnrnrn rn rnrnrn [/code]rn
MFC音乐播放器为什么一打开文件就崩溃了?
照着网上做的:http://blog.csdn.net/codemore/article/details/50151785,编译都通过了,但选择完文件后就崩了,求大神指点[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/9.gif][/img]rnrn[img=https://img-bbs.csdn.net/upload/201801/05/1515140656_104017.jpg][/img]
又是正则...一遇正则就崩溃...-___-!!
[code=HTML]<FORM name="f1" action=".*">rn/*rn<INPUT type="hidden" name="r" value="r">rn*/rn<INPUT type="hidden" name="f" value="f">rndd /*rn<INPUT type="submit" value="xxx"></FORM>rn*/rn<td width="50%">rn //<br id="b1">rn<br id="b2">rn #<br id="b3">rn<br id="b4">rnxxx ;<br id="b5">rn<br id="b6">rn'<br id="b7">rn<br id="b8">rnabcd #<br id="b9">rn<br id="b10">[/code]rnrn如上...要求用5个正则依次 replace [其他split之类的方法不考虑]掉/*...*/之间的内容; 每一行的// [包括//前的空白字符] 之后的内容 (# ; '同)...rn即最终得到如下结果...[color=#FF0000]要求代码兼容opera9.x...其他浏览器可以无视...[/color]rnrn[code=HTML] rnrnddrnrn rn rnxxxrn rn rnabcdrn [/code]
安卓中如何监听某些app打开
需求:编写一个程序能够监听到一些app曾经打开并且在程序里面显示是否打开过,比如com.liulishuo.engzo(英语流利说app)的打开;思路: 首先要有一个Service在后台能够知道任务栈顶端程序是否是com.liulishuo.engzo这样的包名; 如果指定的一个app中包含任务栈顶端的包名,那么就把这个包名和true值存储在SharedPreferences中; 这些app的
在浏览器中js打开安卓app
公司现在做一个app,有一个分享功能,可以分享到微信等app中,然后在微信中打开该页面(转到浏览器中打开),会有一个立即打开的按钮,判断手机上是否安装了该app,如果安装则打开,未安装的话则下载,我现在的解决方案是这样的,[code=javascript]var ua = navigator.userAgent.toLowerCase();rn //alert(ua);rn if (ua.indexOf('android') > -1) rn if (ua.match(/MicroMessenger/i) == 'micromessenger') rn //微信rn alert("安卓微信");rn rn else if(ua.indexOf("mobile mqqbrowser")>-1&&ua.indexOf("sq")>-1)rn alert("安卓手机QQ");rn rn rn else if(ua.indexOf("weibo")>-1)rn alert("新浪微博");rn rn elsern rn var startTime = Date.now();rn var ifr = document.createElement('iframe');rn ifr.src = "myapp://myexample111";rn ifr.style.display = 'none';rn document.body.appendChild(ifr);rn setTimeout(function() rn var endTime = Date.now();rn if (endTime - startTime < 410) //网上大部分会比400大100或者200,但是在手机Q浏览器中打开app的同时还是会弹出下载的,我现在改为410,不知道会不会有问题,rn window.location = "https://www.oschina.net/uploads/osc-android-app-2.4.apk";rn rn , 400); rn rn rn [/code]rn上边的注释部分就是问题,还有大家有没有好的解决方案啊,求指点
安卓App打开微信关注公众号
JumpToBizProfile.Req req = new JumpToBizProfile.Req();rn req.toUserName = "gh_xxxxxxx "; //公众号原始IDrn req.profileType = JumpToBizProfile.JUMP_TO_NORMAL_BIZ_PROFILE;rn req.extMsg = "";rn api.sendReq(req);rn开发平台已经关注了公众号rn测试结果提示:「本次请求无效,请确认是否具有权限」rn这种功能微信现在是否支持,如若不能有没有替代的方法,像是UC扫微信二维码调到微信进行关注,这种功能需要和微信合作才能实现吗,请及时相告谢谢!!
安卓APP与安卓APP后台、进销存管理系统 通信
想请教 安卓app客户端如何与安卓APP后台、进销存管理系统进行对接?n安卓主要有四个功能模块,各个模块之间的业务大体不相同,我想在用Java开发安卓APP客户端,asp.net开发安卓后台(提供APP模块商家注册、登录、维护信息、发布信息),模块之间的订单发到进销存管理系统。n管理系统的数据库是SQL Server,asp.net+C# 想用一种比较简单的方进行双方之间的数据通信和维护。nn本人未开发过安卓应用,请指教。n
webshpere app server 崩溃 ???
webshpere app server 启动时异常 高人来看看rnrn下面是启动日志 rnrn************ Start Display Current Environment ************rnHost Operating System is Windows 2000, version 5.0rnJava version = J2RE 1.4.1 IBM Windows 32 build cn1411-20031011 (JIT enabled: jitc), Java Compiler = jitc, Java VM name = Classic VMrnwas.install.root = d:\Program Files\IBM\WebSphere\AppServerrnuser.install.root = nullrnJava Home = d:\Program Files\IBM\WebSphere\AppServer\java\jrernws.ext.dirs = d:\Program Files\IBM\WebSphere\AppServer\java\lib;d:\Program Files\IBM\WebSphere\AppServer\classes;d:\Program Files\IBM\WebSphere\AppServer\lib;d:\Program Files\IBM\WebSphere\AppServer\lib\ext;d:\Program Files\IBM\WebSphere\AppServer\web\help;d:\Program Files\IBM\WebSphere\AppServer\deploytool\itp\plugins\com.ibm.etools.ejbdeploy\runtimernClasspath = d:\Program Files\IBM\WebSphere\AppServer\properties;d:\Program Files\IBM\WebSphere\AppServer\lib\bootstrap.jar;d:\Program Files\IBM\WebSphere\AppServer\lib\j2ee.jar;d:\Program Files\IBM\WebSphere\AppServer\lib\lmproxy.jar;d:\Program Files\IBM\WebSphere\AppServer\lib\urlprotocols.jarrnJava Library path = d:\Program Files\IBM\WebSphere\AppServer\java\bin;.;C:\WINNT\system32;C:\WINNT;d:\Program Files\IBM\WebSphere\AppServer\bin;d:\Program Files\IBM\WebSphere\AppServer\java\bin;d:\Program Files\IBM\WebSphere\AppServer\java\jre\bin;.;D:\j2sdk1.4.2_04\bin;D:\oracle\ora92\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\WbemrnCurrent trace specification = *=all=disabledrn************* End Display Current Environment *************rn[04-12-9 16:34:52:984 CST] 1cc90220 ManagerAdmin I TRAS0017I: 启动跟踪状态是 *=all=disabled。rn[04-12-9 16:34:53:016 CST] 1cc90220 AdminTool A ADMU3100I: 正在从服务器读取配置:server1rn[04-12-9 16:34:57:844 CST] 1cc90220 WsServerLaunc E ADMU3002E: 试图处理服务器 server1 时发生异常rn[04-12-9 16:34:57:844 CST] 1cc90220 WsServerLaunc E ADMU3007E: 异常 com.ibm.websphere.management.exception.NoServerDefinedException: No configuration defined for server: server1rn at com.ibm.ws.management.launcher.LaunchCommand.(LaunchCommand.java:136)rn at com.ibm.ws.management.tools.WsServerLauncher.initializeRepositoryAndLauncher(WsServerLauncher.java:283)rn at com.ibm.ws.management.tools.WsServerLauncher.runTool(WsServerLauncher.java:176)rn at com.ibm.ws.management.tools.AdminTool.executeUtility(AdminTool.java:173)rn at com.ibm.ws.management.tools.WsServerLauncher.main(WsServerLauncher.java:93)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41)rn at java.lang.reflect.Method.invoke(Method.java:386)rn at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)rnrn[04-12-9 16:34:57:875 CST] 1cc90220 AdminTool E ADMU0111E: 程序退出,带有错误: com.ibm.websphere.management.exception.NoServerDefinedException: No configuration defined for server: server1rn at com.ibm.ws.management.launcher.LaunchCommand.(LaunchCommand.java:136)rn at com.ibm.ws.management.tools.WsServerLauncher.initializeRepositoryAndLauncher(WsServerLauncher.java:283)rn at com.ibm.ws.management.tools.WsServerLauncher.runTool(WsServerLauncher.java:176)rn at com.ibm.ws.management.tools.AdminTool.executeUtility(AdminTool.java:173)rn at com.ibm.ws.management.tools.WsServerLauncher.main(WsServerLauncher.java:93)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41)rn at java.lang.reflect.Method.invoke(Method.java:386)rn at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)rnrn[04-12-9 16:34:57:891 CST] 1cc90220 AdminTool A ADMU0111E: 程序退出,带有错误: com.ibm.websphere.management.exception.NoServerDefinedException: No configuration defined for server: server1rn at com.ibm.ws.management.launcher.LaunchCommand.(LaunchCommand.java:136)rn at com.ibm.ws.management.tools.WsServerLauncher.initializeRepositoryAndLauncher(WsServerLauncher.java:283)rn at com.ibm.ws.management.tools.WsServerLauncher.runTool(WsServerLauncher.java:176)rn at com.ibm.ws.management.tools.AdminTool.executeUtility(AdminTool.java:173)rn at com.ibm.ws.management.tools.WsServerLauncher.main(WsServerLauncher.java:93)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41)rn at java.lang.reflect.Method.invoke(Method.java:386)rn at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)rnrn[04-12-9 16:34:57:969 CST] 1cc90220 AdminTool A ADMU0211I: 在文件 d:\Program Files\IBM\WebSphere\AppServer\logs\server1\startServer.log 中可看到错误的详细信息rn[04-12-9 16:34:57:969 CST] 1cc90220 AdminTool A ADMU1211I: 要获取故障的全部跟踪,使用 -trace 选项。rn
TextView.setText() APP崩溃问题
下面四处//设置TextView.setText时出错,其它的Textview设置正常,注释掉后APP可正常运行,日志信息为空指针异常,rnrn新手,不知怎么解决?rnrnrn private void showWeatherInfo(Weather weather) rn String cityName = weather.basic.cityName;rn String updateTime = weather.basic.update.updateTime.split(" ")[1];rn String degree = weather.now.temperature + "c";rn String weatherInfo = weather.now.mor.info;rn titleCity.setText(cityName);rn titleUpdateTime.setText(updateTime);rn degreeText.setText(degree);rn weatherInfoText.setText(weatherInfo);rn forecastLayout.removeAllViews();rn for (Forecast forecast : weather.forecastList)rn View view = LayoutInflater.from(this).inflate(R.layout.forecast_item,forecastLayout,false);rn TextView dateText = (TextView) findViewById(R.id.date_text);rn TextView infoText = (TextView) findViewById(R.id.info_text);rn TextView maxText = (TextView) findViewById(R.id.max_text);rn TextView minText = (TextView) findViewById(R.id.min_text);rn Log.d("request-定位-date",forecast.date);rn ------------------------------------------------------------------------rn //dateText.setText(forecast.date);rn //infoText.setText(forecast.more.info);rn Log.d("request-定位-info",forecast.more.info);rn //maxText.setText(forecast.temperature.max);rn //minText.setText(forecast.temperature.min);rn ------------------------------------------------------------------------rn Log.d("request-定位-max",forecast.temperature.max);rn Log.d("request-定位-min",forecast.temperature.min);rn forecastLayout.addView(view);rn rnrn if (weather.aqi !=null) rn aqiText.setText(weather.aqi.city.aqi);rn pm25Text.setText(weather.aqi.city.pm25);rn rn String comfor = "舒适度:"+weather.suggestion.comfor.info;rn String carWash = "洗车指数:"+weather.suggestion.carWash.info;rn String sport = "运动指数:"+weather.suggestion.sport.info;rn comfortText.setText(comfor);rn carWashText.setText(carWash);rn sportText.setText(sport);rn weatherLayout.setVisibility(View.VISIBLE);rn rn------------------------------------------------------------------------------------------------rnforecast.xmlrn--------------------rnrnrn rnrn rn rnrnrnrn------------------------------------------------------------------------------rnrnforecast_item.xmlrn----------------rnrnrnrnrn rnrn rnrn rnrn rnrnrn
安卓app升级之安卓app签名
安卓app的签名有两种方式  1.系统默认的方式签名,项目中bin目录下的apk文件即为系统默认签名方式签好名的app安装文件   2.用户自定义的方式签名 签名是安卓的升级的必须要求 安卓的覆盖是有要求的,即在app包名相同的情况下签名的密匙必须相同,否则就不能安卓。当然app的包名不一样也就不叫覆盖安装了。在安卓开发过程中 我们用的是我们自己定义的签名密匙,为什么呢,因为
iOS APP 崩溃日志收集
推荐Bugly(只用过这个第三方的) 通过CocoaPods集成Bugly:pod 'Bugly' (不会CocoaPods:看这里http://blog.csdn.net/u010462316/article/details/76168642) 具体步骤不详细说明了,或者看官方文档里:https://bugly.qq.com/docs/user-guide/instruction-ma
安卓app开发-02-安卓app快速开发
安卓app开发-02-安卓app开发流程 上一篇介绍了安卓 app 开发的工具和环境配置,本篇不涉及编程技术,适合小团队快速高效开发 APP制作流程 当有一个APP创意,该如何实现呢?是花数十万找APP外包?自己能不能开发一个APP?其实大多数人没有多少资源,可以借助最新的一些工具,不需编程技术,自己就能制作出市场上常见的APP,成本可以节约90%左右 这里分享一下自己的APP制作流程,希...
CrashHandler实现UncaughtExceptionHandler拦截android异常
CrashHandler实现UncaughtExceptionHandler拦截android异常基本上每个项目都会有异常,也会需要捕获异常写入文件中,方便查看。为此记录为博客以后查看。/** * UncaughtException处理类,当程序发生Uncaught异常的时候,有该类来接管程序,并记录发送错误报告. * Created by tianlong on 2015/6/18 * *
iOS app崩溃收集
1.  友盟  http://www.umeng.com/       但现在还只支持oc ,不支持swift ,如果是swift代码有问题,捕捉不到问题 MobClick.setCrashReportEnabled(true) MobClick.setLogEnabled(true) let version:String = NSBundle.mainBundle(
iOS App崩溃日志分析
APP新版本上线之前,一般都会经过测试团队的反复测试,确认无bug后才会发布。发布那刻作为开发人员的你,估计欣喜若狂吧,自豪吧!!。发布后线上运行好长一段时间,均安然无恙,可突然有一天你们家CEO说,自家APP崩了,出现闪退了。那一刻在CEO面前感觉弱爆了的感觉有木有啊?着急了吧,抓狂了吧,F**K it, 怎么解决呢?君不必太过忧伤,且听我给你细说。获取iOS APP崩溃日志你造吗,iOS系统会生
APP崩溃的主要原因
Java的异常可以分为两类: UnChecked Exception--(所有RuntimeException类及其子类的实例被称为Runtime异常,即UnChecked Exception,)      UnChecked异常发生时,由于没有相应的try…catch处理该异常对象,所以Java运行环境将会终止,程序将退出,也就是我们        所    说的Crash。 Checked...
android 之APP崩溃自动重启
[code=&quot;java&quot;] /** * Project Name:appPrj_ylwis * File Name:MapData.java * Package Name:com.neomap.ylwis.view.Data.map * Date:2014-3-6下午02:30:47 * Copyright (c) 2014, cfguott@126.com All Righ...
记事本APP崩溃。。。(新手)
用的android studiorn就是 两个Activity之间的跳转,rn点击新建记事 就崩溃了rn错误信息:E/AndroidRuntime: FATAL EXCEPTION: mainrn Process: com.example.administrator.jishiben, PID: 5078rn java.lang.RuntimeException: Unable to start activity ComponentInfocom.example.administrator.jishiben/com.example.administrator.jishiben.Main2Activity: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object referencernrn活动1部分代码:rn[code=java]rnpublic class MainActivity extends Activity implements OnItemClickListener, OnItemLongClickListener rn private Context mContext;rn private ListView listview;rn private SimpleAdapter simp_adapter;rn private List> dataList;rn private Button addNote;rn private TextView tv_content;rn private NotesDB DB;rn private SQLiteDatabase dbread;rnrn @Overridern protected void onCreate(Bundle savedInstanceState) rn super.onCreate(savedInstanceState);rn setContentView(R.layout.activity_main);rn tv_content = (TextView) findViewById(R.id.tv_content);rn listview = (ListView) findViewById(R.id.listview);rn dataList = new ArrayList>();rnrn addNote = (Button) findViewById(R.id.btn_editnote);rn mContext = this;rn addNote.setOnClickListener(new OnClickListener() rnrn @Overridern public void onClick(View arg0) rn Main2Activity.ENTER_STATE = 0;rn Intent intent = new Intent(mContext, Main2Activity.class);rn Bundle bundle = new Bundle();rn bundle.putString("info", "");rn intent.putExtras(bundle);rn startActivityForResult(intent, 1);rn rn );rn DB = new NotesDB(this);rn dbread = DB.getReadableDatabase();rn // 清空数据库中表的内容rn //dbread.execSQL("delete from note");rn RefreshNotesList();rn listview.setOnItemClickListener(this);rn listview.setOnItemLongClickListener(this);rnrn rn public void RefreshNotesList() rnrn int size = dataList.size();rn if (size > 0) rn dataList.removeAll(dataList);rn simp_adapter.notifyDataSetChanged();rn listview.setAdapter(simp_adapter);rn rn simp_adapter = new SimpleAdapter(this, getData(), R.layout.jishi,rn new String[] "tv_content", "tv_date" , new int[] rn R.id.tv_content, R.id.tv_date );rn listview.setAdapter(simp_adapter);rn rnrn private List> getData() rnrn Cursor cursor = dbread.query("note", null, "content!=\"\"", null, null,rn null, null);rnrn while (cursor.moveToNext()) rn String name = cursor.getString(cursor.getColumnIndex("content"));rn String date = cursor.getString(cursor.getColumnIndex("date"));rn Map map = new HashMap();rn map.put("tv_content", name);rn map.put("tv_date", date);rn dataList.add(map);rn rn cursor.close();rn return dataList;rnrn rnrn public void onItemClick(AdapterView arg0, View arg1, int arg2, long arg3) rn Main2Activity.ENTER_STATE = 1;rn // Log.d("arg2", arg2 + "");rn // TextViewrn // content=(TextView)listview.getChildAt(arg2).findViewById(R.id.tv_content);rn // String content1=content.toString();rn String content = listview.getItemAtPosition(arg2) + "";rn String content1 = content.substring(content.indexOf("=") + 1,rn content.indexOf(","));rn Log.d("CONTENT", content1);rn Cursor c = dbread.query("note", null,rn "content=" + "'" + content1 + "'", null, null, null, null);rn while (c.moveToNext()) rn String No = c.getString(c.getColumnIndex("_id"));rn Log.d("TEXT", No);rn // Intent intent = new Intent(mContext, noteEdit.class);rn // intent.putExtra("data", text);rn // setResult(4, intent);rn // // intent.putExtra("data",text);rn // startActivityForResult(intent, 3);rn Intent myIntent = new Intent();rn Bundle bundle = new Bundle();rn bundle.putString("info", content1);rn Main2Activity.id = Integer.parseInt(No);rn myIntent.putExtras(bundle);rn myIntent.setClass(MainActivity.this,Main2Activity.class);rn startActivityForResult(myIntent, 1);rn rn rn protected void onActivityResult(int requestCode, int resultCode, Intent data) rn // TODO Auto-generated method stubrn super.onActivityResult(requestCode, resultCode, data);rn if (requestCode == 1 && resultCode == 2) rn RefreshNotesList();rn rn rn[/code]rnrn活动2代码:rn[code=java]package com.example.administrator.jishiben;rnrnimport android.support.v7.app.AppCompatActivity;rnimport android.os.Bundle;rnimport java.text.SimpleDateFormat;rnimport java.util.Date;rnrnimport android.app.Activity;rnimport android.content.Context;rnimport android.content.Intent;rnimport android.database.sqlite.SQLiteDatabase;rnimport android.database.sqlite.SQLiteStatement;rnimport android.os.Bundle;rnimport android.util.Log;rnimport android.view.View;rnimport android.view.View.OnClickListener;rnimport android.view.Window;rnimport android.view.WindowManager;rnimport android.view.inputmethod.InputMethodManager;rnimport android.widget.Button;rnimport android.widget.EditText;rnimport android.widget.TextView;rnrnpublic class Main2Activity extends Activity rn private TextView tv_date;rn private EditText et_content;rn private Button btn_ok;rn private Button btn_cancel;rn private NotesDB DB;rn private SQLiteDatabase dbread;rn public static int ENTER_STATE = 0;rn public static String last_content;rn public static int id;rnrn @Overridern protected void onCreate(Bundle savedInstanceState) rn // TODO Auto-generated method stubrn super.onCreate(savedInstanceState);rn // 设置无标题rn requestWindowFeature(Window.FEATURE_NO_TITLE);rn setContentView(R.layout.activity_main2);rnrn tv_date = (TextView) findViewById(R.id.tv_date);rn Date date = new Date();rn SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");rn String dateString = sdf.format(date);rn tv_date.setText(dateString);rnrn et_content = (EditText) findViewById(R.id.et_content);rn // 设置软键盘自动弹出rn getWindow().setSoftInputMode(rn WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);rnrn DB = new NotesDB(this);rn dbread = DB.getReadableDatabase();rnrn Bundle myBundle = this.getIntent().getExtras();rn last_content = myBundle.getString("info");rn Log.d("LAST_CONTENT", last_content);rn et_content.setText(last_content);rn // 确认按钮的点击事件rn btn_ok = (Button) findViewById(R.id.btn_ok);rn btn_ok.setOnClickListener(new OnClickListener() rn public void onClick(View arg0) rn // 获取日志内容rn String content = et_content.getText().toString();rn Log.d("LOG1", content);rn // 获取写日志时间rn Date date = new Date();rn SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");rn String dateNum = sdf.format(date);rn String sql;rn String sql_count = "SELECT COUNT(*) FROM note";rn SQLiteStatement statement = dbread.compileStatement(sql_count);rn long count = statement.simpleQueryForLong();rn Log.d("COUNT", count + "");rn Log.d("ENTER_STATE", ENTER_STATE + "");rn // 添加一个新的日志rn if (ENTER_STATE == 0) rn if (!content.equals("")) rn sql = "insert into " + NotesDB.TABLE_NAME_NOTESrn + " values(" + count + "," + "'" + contentrn + "'" + "," + "'" + dateNum + "')";rn Log.d("LOG", sql);rn dbread.execSQL(sql);rn rn rn // 查看并修改一个已有的日志rn else rn Log.d("执行命令", "执行了该函数");rn String updatesql = "update note set content='"rn + content + "' where _id=" + id;rn dbread.execSQL(updatesql);rn // et_content.setText(last_content);rn rn Intent data = new Intent();rn setResult(2, data);rn finish();rn rn );rn btn_cancel = (Button) findViewById(R.id.btn_cancel);rn btn_cancel.setOnClickListener(new OnClickListener() rn public void onClick(View arg0) rn finish();rn rn );rn rnrn @Overridern protected void onActivityResult(int requestCode, int resultCode, Intent data) rn // TODO Auto-generated method stubrn super.onActivityResult(requestCode, resultCode, data);rn // if (requestCode == 3 && resultCode == 4) rn // last_content=data.getStringExtra("data");rn // Log.d("LAST_STRAING", last_content+"gvg");rn // rn rn[/code]rn
查看ios app崩溃
ios
APP崩溃日志记录及发送邮件
App崩溃保存崩溃日志到本地,及询问客户是否需要发送邮件给开发人员
app崩溃原因解析
app崩溃原因解析,说明了APP崩溃引起的原因,不够详细,请后者补充
相关热词 c# login 居中 c# 考试软件 c# 自然语言分析 c# 分段读取文件 c# 泛型反射 c#打断点 c# 时间转多少秒 c# 线程函数加参数 c# modbus 读取 c#查询集合表