Android 能够在Eclipse中运行,但在mobile上强制关闭

Android 能够在Eclipse中运行,但在mobile上强制关闭,android,forceclose,Android,Forceclose,登录页面后,我的订购应用程序将转到扫描仪、列表和订购。 在我点击Order进入目录后,它可以在eclipse虚拟设备上运行,但不能在移动设备上运行。其他页面可以 这是CatalogActivity.java package com.example.barcode; import java.util.List; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import

登录页面后,我的订购应用程序将转到扫描仪、列表和订购。 在我点击Order进入目录后,它可以在eclipse虚拟设备上运行,但不能在移动设备上运行。其他页面可以

这是CatalogActivity.java

package com.example.barcode;

import java.util.List;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.Button;
import android.widget.ListView;

public class CatalogActivity extends Activity {

 private List<Product> mProductList;
 Button button;


 @Override
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.catalog);

  // Obtain a reference to the product catalog
  mProductList = ShoppingCartHelper.getCatalog(getResources());

  // Create the list
  ListView listViewCatalog = (ListView) findViewById(R.id.ListViewCatalog);
  listViewCatalog.setAdapter(new ProductAdapter(mProductList, getLayoutInflater(), false));

 listViewCatalog.setOnItemClickListener(new OnItemClickListener() {

  @Override
  public void onItemClick(AdapterView<?> parent, View view, int position,
    long id) {
   Intent productDetailsIntent = new         Intent(getBaseContext(),ProductDetailsActivity.class);
   productDetailsIntent.putExtra(ShoppingCartHelper.PRODUCT_INDEX, position);
  startActivity(productDetailsIntent);
}
});

Button viewShoppingCart = (Button) findViewById(R.id.ButtonViewCart);
viewShoppingCart.setOnClickListener(new OnClickListener() {

 @Override
 public void onClick(View v) {
  Intent viewShoppingCartIntent = new Intent(getBaseContext(), ShoppingCartActivity.class);
  startActivity(viewShoppingCartIntent);
 }
});

}

必须找到长度为零的字符串。这是错误发生时生成的完整日志吗? 读取文件时会发生IO异常,但在发布的代码中没有文件操作。
另外,代码的这一部分似乎没有错误。

代码中的哪一行引发异常?sry我听不懂你的意思,你能给我解释一下吗?
04-09 01:45:45.174 E/SpannableStringBuilder(30213): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

04-09 01:45:48.484 E/SpannableStringBuilder(30213): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

04-09 01:45:48.484 E/SpannableStringBuilder(30213): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

04-09 01:45:56.939 E/SpannableStringBuilder(30213): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

04-09 01:45:56.939 E/SpannableStringBuilder(30213): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

04-09 01:45:57.424 E/SpannableStringBuilder(30213): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

04-09 01:45:57.424 E/SpannableStringBuilder(30213): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

04-09 01:45:57.429 E/System  (30213): Uncaught exception thrown by finalizer

04-09 01:45:57.429 E/System  (30213): java.io.IOException: close failed: EIO (I/O error)

04-09 01:45:57.429 E/System  (30213):   at libcore.io.IoUtils.close(IoUtils.java:41)

04-09 01:45:57.429 E/System  (30213):   at java.io.FileOutputStream.close(FileOutputStream.java:139)

04-09 01:45:57.429 E/System  (30213):   at java.io.FileOutputStream.finalize(FileOutputStream.java:153)

04-09 01:45:57.429 E/System  (30213):   at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:186)

04-09 01:45:57.429 E/System  (30213):   at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:169)

04-09 01:45:57.429 E/System  (30213):   at java.lang.Thread.run(Thread.java:856)

04-09 01:45:57.429 E/System  (30213): Caused by: libcore.io.ErrnoException: close failed: EIO (I/O error)

04-09 01:45:57.429 E/System  (30213):   at libcore.io.Posix.close(Native Method)

04-09 01:45:57.429 E/System  (30213):   at libcore.io.BlockGuardOs.close(BlockGuardOs.java:75)

04-09 01:45:57.429 E/System  (30213):   at libcore.io.IoUtils.close(IoUtils.java:38)

04-09 01:45:57.429 E/System  (30213):   ... 5 more

04-09 01:45:57.434 E/System  (30213): Uncaught exception thrown by finalizer

04-09 01:45:57.434 E/System  (30213): java.io.IOException: close failed: EIO (I/O error)

04-09 01:45:57.434 E/System  (30213):   at libcore.io.IoUtils.close(IoUtils.java:41)

04-09 01:45:57.434 E/System  (30213):   at java.io.FileInputStream.close(FileInputStream.java:121)
04-09 01:45:57.434 E/System  (30213):   at java.io.FileInputStream.finalize(FileInputStream.java:142)

04-09 01:45:57.434 E/System  (30213):   at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:186)

04-09 01:45:57.434 E/System  (30213):   at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:169)

04-09 01:45:57.434 E/System  (30213):   at java.lang.Thread.run(Thread.java:856)

04-09 01:45:57.434 E/System  (30213): Caused by: libcore.io.ErrnoException: close failed: EIO (I/O error)

04-09 01:45:57.434 E/System  (30213):   at libcore.io.Posix.close(Native Method)

04-09 01:45:57.434 E/System  (30213):   at libcore.io.BlockGuardOs.close(BlockGuardOs.java:75)

04-09 01:45:57.434 E/System  (30213):   at libcore.io.IoUtils.close(IoUtils.java:38)

04-09 01:45:57.434 E/System  (30213):   ... 5 more

04-09 01:45:58.214 E/SpannableStringBuilder(30213): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

04-09 01:45:58.214 E/SpannableStringBuilder(30213): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

04-09 01:46:00.394 E/SpannableStringBuilder(30213): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

04-09 01:46:00.394 E/SpannableStringBuilder(30213): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

04-09 01:46:30.454 E/SpannableStringBuilder(30213): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

04-09 01:46:30.454 E/SpannableStringBuilder(30213): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

04-09 01:46:30.879 E/SpannableStringBuilder(30213): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

04-09 01:46:30.879 E/SpannableStringBuilder(30213): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

04-09 01:47:01.334 E/SpannableStringBuilder(30213): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

04-09 01:47:01.334 E/SpannableStringBuilder(30213): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

04-09 01:47:02.439 E/Dynamiclayout(30213): java.lang.IndexOutOfBoundsException: charAt: 0 >= length 0

04-09 01:47:02.664 E/SpannableStringBuilder(30213): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

04-09 01:47:02.664 E/SpannableStringBuilder(30213): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

04-09 01:47:22.089 E/SpannableStringBuilder(30213): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

04-09 01:47:22.089 E/SpannableStringBuilder(30213): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

04-09 01:47:23.169 E/SpannableStringBuilder(30213): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

04-09 01:47:23.169 E/SpannableStringBuilder(30213): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length