Android应用程序在一台设备上崩溃,而在另一台设备上崩溃

时间:2015-02-13 16:07:00

标签: android android-fragments android-version

下面的代码会使应用程序在meizu手机上崩溃,但不会在我的galaxy s2上崩溃。 (魅族版本较新但不是我的,不在这里,所以我不知道版本是什么)

public void onClick(View v){
    et= (EditText) findViewById(R.id.searchEdit);
    int newArrIndex= 0;
    Log.d("BeforeFirst","BeforeFirst");
    String [] newArr=new String [contactsArray.length];
    for (int i=0;i<contactsArray.length;i++){
        if(et.getText().toString().contains("blibli")){
            newArr[0]="bla";
            newArr[1]="blo";
            break;
        }
        else if(et.getText().toString().contains("blabla")){
            newArr[0]="bli";
            newArr[1]="blu";
            break;
        }
        if(contactsArray[i].contains(et.getText().toString())){
            newArr[newArrIndex]=contactsArray[i];
            newArrIndex++;
        }
        et.setSelected(false);
    }

    Bundle bundle=new Bundle();
    bundle.putStringArray("contacts",newArr);

    MyPlaceholderFragment frag=new MyPlaceholderFragment();
    frag.setArguments(bundle);
    getSupportFragmentManager().beginTransaction()
            .add(R.id.container, frag)
            .commit();
    setContentView(R.layout.activity_search);
}

当我点击进入我的galaxy s2键盘时,我得到了我想要的东西。 当我在魅族mx4上做同样的事情时,按下回车后它会崩溃。 那么这里可能出现什么问题呢? 它必须是一些与两部手机都不兼容的android类(而不是我的愚蠢程序 - 因为它有效)

手机不是我的,而不是我,所以我没有错误日志。 任何的想法?方向? 非常感谢。

0 个答案:

没有答案